Skip to content

Commit

Permalink
change initial value
Browse files Browse the repository at this point in the history
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
  • Loading branch information
Lloyd-Pottiger committed Jun 9, 2022
1 parent 0b514a9 commit 4c58b05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 1 addition & 2 deletions dbms/src/Server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "Server.h"

#include <AggregateFunctions/registerAggregateFunctions.h>
#include <Common/CPUAffinityManager.h>
#include <Common/ClickHouseRevision.h>
Expand Down Expand Up @@ -56,6 +54,7 @@
#include <Poco/StringTokenizer.h>
#include <Poco/Timestamp.h>
#include <Server/RaftConfigParser.h>
#include <Server/Server.h>
#include <Server/ServerInfo.h>
#include <Server/StorageConfigParser.h>
#include <Server/UserConfigParser.h>
Expand Down
9 changes: 6 additions & 3 deletions dbms/src/Server/ServerInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
// limitations under the License.

#pragma once
#include <Common/getNumberOfPhysicalCPUCores.h>
#include <common/getMemoryAmount.h>
#include <common/types.h>

#include <thread>
#include <vector>

#pragma GCC diagnostic push
Expand All @@ -33,9 +36,9 @@ class ServerInfo
struct CPUInfo
{
/// number of logical CPU cores
UInt16 logical_cores = 0; // set default value to 0 which means INVALID server info
UInt16 logical_cores = std::thread::hardware_concurrency();
/// number of physical CPU cores
UInt16 physical_cores = 1; // the minimum number of physical_cores is 1
UInt16 physical_cores = getNumberOfPhysicalCPUCores();
/// number of L1 cache size
/// units: Byte
UInt32 l1_cache_size = 16384; // 16KB (typical value)
Expand Down Expand Up @@ -78,7 +81,7 @@ class ServerInfo
{
/// total memory size
/// units: Byte
UInt64 capacity = 0;
UInt64 capacity = getMemoryAmount();
};

ServerInfo() = default;
Expand Down

0 comments on commit 4c58b05

Please sign in to comment.