diff --git a/example/demo/data/hos_upload_complete b/example/demo/data/hos_upload_complete deleted file mode 100755 index 045f53b2..00000000 Binary files a/example/demo/data/hos_upload_complete and /dev/null differ diff --git a/example/demo/data/hos_write_complete b/example/demo/data/hos_write_complete deleted file mode 100755 index 2738dc46..00000000 Binary files a/example/demo/data/hos_write_complete and /dev/null differ diff --git a/example/performance/HosClientPerformance.cpp b/example/performance/HosClientPerformance.cpp index 3b42b892..4f7d4c4a 100644 --- a/example/performance/HosClientPerformance.cpp +++ b/example/performance/HosClientPerformance.cpp @@ -199,9 +199,9 @@ static int upload_buff(char * buff, int buff_len, int test_times, thread_info_t conf_t *conf = &thread_info->conf; char file_size[128]; char append_size[128]; - size_t drop_cnt = 0; + size_t success_cnt = 0; + int ret = 0; - fd = hos_open_fd(thread_info->handle, conf->bucket, conf->object, callback, NULL, thread_info->thread_num, conf->mode); #if 0 size_t time_tmp = 0; while(1) @@ -248,6 +248,7 @@ static int upload_buff(char * buff, int buff_len, int test_times, thread_info_t #else if (conf->mode & APPEND_MODE) { + fd = hos_open_fd(thread_info->handle, conf->bucket, conf->object, callback, NULL, thread_info->thread_num, conf->mode); clock_gettime(CLOCK_MONOTONIC, &tstart); for (i = 0; i < test_times; i++) { @@ -278,15 +279,22 @@ static int upload_buff(char * buff, int buff_len, int test_times, thread_info_t clock_gettime(CLOCK_MONOTONIC, &tstart); for (i = 0; i < test_times; i++) { - if (hos_write(fd, buff, buff_len, thread_info->thread_num) != HOS_CLIENT_OK) + fd = hos_open_fd(thread_info->handle, conf->bucket, conf->object, callback, NULL, thread_info->thread_num, conf->mode); + ret = hos_write(fd, buff, buff_len, thread_info->thread_num); + if (ret == HOS_CLIENT_OK) { - //printf("error: hos_write error\n"); - drop_cnt++; + success_cnt++; + }else + { + printf("error code:%d\n", ret); } } clock_gettime(CLOCK_MONOTONIC, &ttmp); time = calc_time(tstart, ttmp); - time /= (test_times - drop_cnt); + if (success_cnt) + time /= success_cnt; + else + time /= test_times; sprintf(file_size, "%dk", buff_len / 1024); sprintf(append_size, "%luk", conf->append_size / 1024); @@ -295,7 +303,6 @@ static int upload_buff(char * buff, int buff_len, int test_times, thread_info_t thread_info->thread_num, file_size, 0, 0, time); } - #endif hos_close_fd(fd, thread_info->thread_num); @@ -437,7 +444,7 @@ int main(int argc, char *argv[]) break; case 'p': conf.pool_size = atoi(optarg); - conf.pool_size = MIN(3000, conf.pool_size); + conf.pool_size = MIN(4000, conf.pool_size); break; case 't': conf.thread_sum = atoi(optarg); @@ -484,6 +491,9 @@ int main(int argc, char *argv[]) return -1; } + set_thread_sum(handle, conf.thread_sum); + set_cache_size(handle, conf.append_size); + //创建bucket if (hos_create_bucket(handle, conf.bucket)) { @@ -501,6 +511,7 @@ int main(int argc, char *argv[]) { printf("%-20s%-20s%-20s%-20s%-20s\n", "thread_id", "file_size", "write_time", "upload_time", "total_time"); } + hos_expand_fs2(handle, "./log/fs2.log", 0, "127.0.0.1", 8001); for ( thread_num = 0; thread_num < conf.thread_sum; thread_num++ ) { thread_info[thread_num].conf = conf; diff --git a/support/CMakeLists.txt b/support/CMakeLists.txt index fe3ff9c5..b9151559 100644 --- a/support/CMakeLists.txt +++ b/support/CMakeLists.txt @@ -3,7 +3,8 @@ include(ExternalProject) set(AWSS3_ROOT ${CMAKE_CURRENT_BINARY_DIR}) set(AWSS3_URL ${CMAKE_CURRENT_SOURCE_DIR}/aws-sdk-cpp-master.zip) #set(AWSS3_URL_MD5 a94cce4fe5003acf55fe1eac8c49ad4f) -set(AWSS3_URL_MD5 9128a9cc628a24f0c2f8b19e36d8327c) +set(AWSS3_URL_MD5 dcdcd3cd6d2864f7efbfa90db6f5bf32) +#set(AWSS3_URL_MD5 1bb2784d5f39ff05fcf2c30092dc8a66) set(AWSS3_CONFIGURE cd ${AWSS3_ROOT}/aws-sdk-cpp-master/src/aws-sdk-cpp-master && cmake . -DBUILD_ONLY=s3 -DCMAKE_BUILD_TYPE=Debug) set(AWSS3_MAKE cd ${AWSS3_ROOT}/aws-sdk-cpp-master/src/aws-sdk-cpp-master && make) set(AWSS3_INSTALL cd ${AWSS3_ROOT}/aws-sdk-cpp-master/src/aws-sdk-cpp-master && make install PREFIX=${SUPPORT_INSTALL_PREFIX}) diff --git a/support/aws-sdk-cpp-master.zip b/support/aws-sdk-cpp-master.zip index e5a15c20..b626df62 100644 Binary files a/support/aws-sdk-cpp-master.zip and b/support/aws-sdk-cpp-master.zip differ