Commit 5220a393 authored by starlord's avatar starlord
Browse files

format unittest code


Former-commit-id: 876a54437b8d5150a2a3d2b4c16b4983783cef42
parents c9320225 37e26cce
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -50,10 +50,9 @@ Centos7 :
$ yum install gfortran qt4 flex bison 
$ yum install mysql-devel mysql
    
Ubuntu16.04 : 
Ubuntu 16.04 or 18.04: 
$ sudo apt-get install gfortran qt4-qmake flex bison 
$ sudo apt-get install libmysqlclient-dev mysql-client
       
```

Verify the existence of `libmysqlclient_r.so`:
@@ -66,6 +65,10 @@ $ locate libmysqlclient_r.so
If not, you need to create a symbolic link:

```shell
# Locate libmysqlclient.so
$ sudo updatedb
$ locate libmysqlclient.so 

# Create symbolic link
$ sudo ln -s /path/to/libmysqlclient.so /path/to/libmysqlclient_r.so
```
@@ -90,7 +93,7 @@ please reinstall CMake with curl:
   ```shell
   CentOS 7:   
   $ yum install curl-devel
   Ubuntu 16.04: 
   Ubuntu 16.04 or 18.04: 
   $ sudo apt-get install libcurl4-openssl-dev
   ```

@@ -106,7 +109,7 @@ please reinstall CMake with curl:
```shell
CentOS 7:   
$ yum install clang
Ubuntu 16.04: 
Ubuntu 16.04 or 18.04: 
$ sudo apt-get install clang-format clang-tidy
    
$ ./build.sh -l
@@ -123,7 +126,7 @@ $ ./build.sh -u
```shell
CentOS 7:   
$ yum install lcov
Ubuntu 16.04: 
Ubuntu 16.04 or 18.04: 
$ sudo apt-get install lcov
    
$ ./build.sh -u -c
+2 −4
Original line number Diff line number Diff line
*cmake-build-debug*
*cmake-build-release*
*cmake_build*
*src/thirdparty*
*src/core/thirdparty*
*thirdparty*
*src/grpc*
*easylogging++*
*SqliteMetaImpl.cpp
*src/grpc*
*src/core*
*src/wrapper*
 No newline at end of file
*unittest/wrapper*
 No newline at end of file
+3 −3
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ if [[ ${RUN_CPPLINT} == "ON" ]]; then
        echo "ERROR! cpplint check failed"
        exit 1
    fi
    echo "cpplint check pass!"
    echo "cpplint check passed!"

#    # clang-format check
#    make check-clang-format
@@ -110,7 +110,7 @@ if [[ ${RUN_CPPLINT} == "ON" ]]; then
#        echo "ERROR! clang-format check failed"
#        exit 1
#    fi
#    echo "clang-format check pass!"
#    echo "clang-format check passed!"
#
#    # clang-tidy check
#    make check-clang-tidy
@@ -118,7 +118,7 @@ if [[ ${RUN_CPPLINT} == "ON" ]]; then
#        echo "ERROR! clang-tidy check failed"
#        exit 1
#    fi
#    echo "clang-tidy check pass!"
#    echo "clang-tidy check passed!"
else
    # compile and build
    make -j 4 || exit 1
+9 −7
Original line number Diff line number Diff line
# All the following configurations are default values.
# Default values are used when you make no changes to the following parameters.

server_config:
  address: 0.0.0.0                  # milvus server ip address (IPv4)
@@ -11,25 +11,27 @@ db_config:
  secondary_path:                   # path used to store data only, split by semicolon

  backend_url: sqlite://:@:/        # URI format: dialect://username:password@host:port/database
                                    # Keep 'dialect://:@:/', and replace other texts with real values.
                                    # Keep 'dialect://:@:/', and replace other texts with real values
                                    # Replace 'dialect' with 'mysql' or 'sqlite'

  insert_buffer_size: 4             # GB, maximum insert buffer size allowed
                                    # sum of insert_buffer_size and cpu_cache_capacity cannot exceed total memory
  build_index_gpu: 0                # gpu id used for building index

metric_config:
  enable_monitor: false             # enable monitoring or not
  collector: prometheus             # prometheus
  prometheus_config:
    port: 8080                      # port prometheus used to fetch metrics
    port: 8080                      # port prometheus uses to fetch metrics

cache_config:
  cpu_mem_capacity: 16              # GB, CPU memory used for cache
  cpu_mem_threshold: 0.85           # percentage of data kept when cache cleanup triggered
  cache_insert_data: false          # whether load inserted data into cache
  cpu_cache_capacity: 16            # GB, CPU memory used for cache
  cpu_cache_threshold: 0.85         # percentage of data that will be kept when cache cleanup is triggered
  cache_insert_data: false          # whether to load inserted data into cache

engine_config:
  blas_threshold: 20
  use_blas_threshold: 20            # if nq <  use_blas_threshold, use SSE, faster with fluctuated response times
                                    # if nq >= use_blas_threshold, use OpenBlas, slower with stable response times

resource_config:
  resource_pool:
+8 −8
Original line number Diff line number Diff line
@@ -34,23 +34,23 @@ CpuCacheMgr::CpuCacheMgr() {
    server::Config &config = server::Config::GetInstance();
    Status s;

    int32_t cpu_mem_cap;
    s = config.GetCacheConfigCpuMemCapacity(cpu_mem_cap);
    int32_t cpu_cache_cap;
    s = config.GetCacheConfigCpuCacheCapacity(cpu_cache_cap);
    if (!s.ok()) {
        SERVER_LOG_ERROR << s.message();
    }
    int64_t cap = cpu_mem_cap * unit;
    int64_t cap = cpu_cache_cap * unit;
    cache_ = std::make_shared<Cache<DataObjPtr>>(cap, 1UL << 32);

    float cpu_mem_threshold;
    s = config.GetCacheConfigCpuMemThreshold(cpu_mem_threshold);
    float cpu_cache_threshold;
    s = config.GetCacheConfigCpuCacheThreshold(cpu_cache_threshold);
    if (!s.ok()) {
        SERVER_LOG_ERROR << s.message();
    }
    if (cpu_mem_threshold > 0.0 && cpu_mem_threshold <= 1.0) {
        cache_->set_freemem_percent(cpu_mem_threshold);
    if (cpu_cache_threshold > 0.0 && cpu_cache_threshold <= 1.0) {
        cache_->set_freemem_percent(cpu_cache_threshold);
    } else {
        SERVER_LOG_ERROR << "Invalid cpu_mem_threshold: " << cpu_mem_threshold
        SERVER_LOG_ERROR << "Invalid cpu_cache_threshold: " << cpu_cache_threshold
                         << ", by default set to " << cache_->freemem_percent();
    }
}
Loading