Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
indiff7643
Terarkdb
提交
917c8a8b
T
Terarkdb
项目概览
indiff7643
/
Terarkdb
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Terarkdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
917c8a8b
编写于
12月 28, 2020
作者:
W
wangyi.ywq
提交者:
奏之章
2月 08, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[cherry-pick]
上级
478425e0
变更
11
展开全部
隐藏空白更改
内联
并排
Showing
11 changed file
with
86 addition
and
426 deletion
+86
-426
db/db_impl.cc
db/db_impl.cc
+1
-2
db/db_impl.h
db/db_impl.h
+12
-18
db/db_impl_gc_ttl_test.cc
db/db_impl_gc_ttl_test.cc
+1
-1
monitoring/persistent_stats_history.cc
monitoring/persistent_stats_history.cc
+2
-2
monitoring/persistent_stats_history.h
monitoring/persistent_stats_history.h
+1
-1
monitoring/stats_dump_scheduler.cc
monitoring/stats_dump_scheduler.cc
+2
-2
monitoring/stats_history_test.cc
monitoring/stats_history_test.cc
+65
-397
tools/db_bench_tool.cc
tools/db_bench_tool.cc
+1
-0
trace_replay/block_cache_tracer.h
trace_replay/block_cache_tracer.h
+0
-1
util/timer.h
util/timer.h
+1
-0
util/timer_test.cc
util/timer_test.cc
+0
-2
未找到文件。
db/db_impl.cc
浏览文件 @
917c8a8b
...
...
@@ -58,7 +58,6 @@
#include "monitoring/in_memory_stats_history.h"
#include "monitoring/iostats_context_imp.h"
#include "monitoring/perf_context_imp.h"
#include "trace_replay/block_cache_tracer.h"
#include "monitoring/stats_dump_scheduler.h"
#include "monitoring/persistent_stats_history.h"
#include "monitoring/thread_status_updater.h"
...
...
@@ -813,7 +812,7 @@ void DBImpl::PersistStats() {
return
;
}
TEST_SYNC_POINT
(
"DBImpl::PersistStats:StartRunning"
);
uint64_t
now_seconds
=
env_
->
NowMicros
()
/
kMicrosInSecond
;
uint64_t
now_seconds
=
env_
->
NowMicros
()
/
1000
*
1000
;
Statistics
*
statistics
=
immutable_db_options_
.
statistics
.
get
();
if
(
!
statistics
)
{
return
;
...
...
db/db_impl.h
浏览文件 @
917c8a8b
...
...
@@ -83,6 +83,8 @@ struct JobContext;
struct
ExternalSstFileInfo
;
struct
MemTableInfo
;
const
uint64_t
kMicrosInSecond
=
1000
*
1000
;
class
DBImpl
:
public
DB
{
public:
DBImpl
(
const
DBOptions
&
options
,
const
std
::
string
&
dbname
,
...
...
@@ -257,8 +259,6 @@ class DBImpl : public DB {
virtual
Status
GetDbIdentity
(
std
::
string
&
identity
)
const
override
;
virtual
Status
GetDbIdentityFromIdentityFile
(
std
::
string
*
identity
)
const
;
virtual
Status
GetDbSessionId
(
std
::
string
&
session_id
)
const
override
;
ColumnFamilyHandle
*
DefaultColumnFamily
()
const
override
;
...
...
@@ -381,8 +381,6 @@ class DBImpl : public DB {
// match to our in-memory records
virtual
Status
CheckConsistency
(
bool
read_only
);
virtual
Status
GetDbIdentity
(
std
::
string
&
identity
)
const
override
;
Status
RunManualCompaction
(
ColumnFamilyData
*
cfd
,
int
input_level
,
int
output_level
,
uint32_t
output_path_id
,
uint32_t
max_subcompactions
,
const
Slice
*
begin
,
...
...
@@ -400,6 +398,14 @@ class DBImpl : public DB {
LogsWithPrepTracker
*
logs_with_prep_tracker
()
{
return
&
logs_with_prep_tracker_
;
}
// persist stats to column family "_persistent_stats"
void
PersistStats
();
// dump rocksdb.stats to LOG
void
DumpStats
();
//
void
ScheduleGCTTL
();
#ifndef NDEBUG
// Extra methods (for testing) that are not in the public DB interface
...
...
@@ -491,8 +497,7 @@ class DBImpl : public DB {
int
TEST_BGGarbageCollectionAllowed
()
const
;
int
TEST_BGFlushesAllowed
()
const
;
size_t
TEST_GetWalPreallocateBlockSize
(
uint64_t
write_buffer_size
)
const
;
void
TEST_WaitForDumpStatsRun
(
std
::
function
<
void
()
>
callback
)
const
;
void
TEST_WaitForPersistStatsRun
(
std
::
function
<
void
()
>
callback
)
const
;
void
TEST_WaitForStatsDumpRun
(
std
::
function
<
void
()
>
callback
)
const
;
bool
TEST_IsPersistentStatsEnabled
()
const
;
size_t
TEST_EstiamteStatsHistorySize
()
const
;
...
...
@@ -780,7 +785,6 @@ class DBImpl : public DB {
// finishes. For example in CompactRange.
Status
TEST_AtomicFlushMemTables
(
const
autovector
<
ColumnFamilyData
*>&
cfds
,
const
FlushOptions
&
flush_opts
);
void
TEST_WaitForStatsDumpRun
(
std
::
function
<
void
()
>
callback
)
const
;
size_t
TEST_EstimateInMemoryStatsHistorySize
()
const
;
VersionSet
*
TEST_GetVersionSet
()
const
{
return
versions_
.
get
();
}
...
...
@@ -904,8 +908,7 @@ class DBImpl : public DB {
virtual
Status
Recover
(
const
std
::
vector
<
ColumnFamilyDescriptor
>&
column_families
,
bool
read_only
=
false
,
bool
error_if_log_file_exist
=
false
,
bool
error_if_data_exists_in_logs
=
false
,
uint64_t
*
recovered_seq
=
nullptr
);
bool
error_if_data_exists_in_logs
=
false
);
virtual
bool
OwnTablesAndLogs
()
const
{
return
true
;
}
...
...
@@ -1242,15 +1245,6 @@ class DBImpl : public DB {
size_t
EstimateInMemoryStatsHistorySize
()
const
;
// persist stats to column family "_persistent_stats"
void
PersistStats
();
// dump rocksdb.stats to LOG
void
DumpStats
();
//
void
ScheduleGCTTL
();
// Return the minimum empty level that could hold the total data in the
// input level. Return the input level, if such level could not be found.
int
FindMinimumEmptyLevelFitting
(
ColumnFamilyData
*
cfd
,
...
...
db/db_impl_gc_ttl_test.cc
浏览文件 @
917c8a8b
...
...
@@ -69,7 +69,7 @@ TEST_F(DBImplGCTTL_Test, L0FileExpiredTest) {
}
ASSERT_EQ
(
10
,
dbfull
()
->
GetDBOptions
().
stats_dump_period_sec
);
dbfull
()
->
TEST_WaitFor
DumpStats
Run
([
&
]
{
mock_env
->
set_current_time
(
ttl
);
});
dbfull
()
->
TEST_WaitFor
StatsDump
Run
([
&
]
{
mock_env
->
set_current_time
(
ttl
);
});
ASSERT_TRUE
(
flag
);
ASSERT_EQ
(
L0FilesNums
,
mark
);
dbfull
()
->
TEST_WaitForCompact
();
...
...
monitoring/persistent_stats_history.cc
浏览文件 @
917c8a8b
...
...
@@ -11,7 +11,7 @@
#include <cstring>
#include <string>
#include <utility>
#include "db/db_impl
/db_impl
.h"
#include "db/db_impl.h"
#include "port/likely.h"
#include "util/string_util.h"
...
...
@@ -69,7 +69,7 @@ void OptimizeForPersistentStats(ColumnFamilyOptions* cfo) {
cfo
->
write_buffer_size
=
2
<<
20
;
cfo
->
target_file_size_base
=
2
*
1048576
;
cfo
->
max_bytes_for_level_base
=
10
*
1048576
;
cfo
->
snap_refresh_nanos
=
0
;
//
cfo->snap_refresh_nanos = 0;
cfo
->
soft_pending_compaction_bytes_limit
=
256
*
1048576
;
cfo
->
hard_pending_compaction_bytes_limit
=
1073741824ul
;
cfo
->
compression
=
kNoCompression
;
...
...
monitoring/persistent_stats_history.h
浏览文件 @
917c8a8b
...
...
@@ -8,7 +8,7 @@
#pragma once
#include "db/db_impl
/db_impl
.h"
#include "db/db_impl.h"
#include "rocksdb/stats_history.h"
namespace
rocksdb
{
...
...
monitoring/stats_dump_scheduler.cc
浏览文件 @
917c8a8b
...
...
@@ -5,11 +5,11 @@
#include "monitoring/stats_dump_scheduler.h"
#include "db/db_impl
/db_impl
.h"
#include "db/db_impl.h"
#include "util/cast_util.h"
#ifndef ROCKSDB_LITE
namespace
ROCKSDB_NAMESPACE
{
namespace
rocksdb
{
StatsDumpScheduler
::
StatsDumpScheduler
(
Env
*
env
)
{
timer
=
std
::
unique_ptr
<
Timer
>
(
new
Timer
(
env
));
...
...
monitoring/stats_history_test.cc
浏览文件 @
917c8a8b
此差异已折叠。
点击以展开。
tools/db_bench_tool.cc
浏览文件 @
917c8a8b
...
...
@@ -1501,6 +1501,7 @@ class ReporterAgent {
}
auto
total_ops_done_snapshot
=
total_ops_done_
.
load
();
// round the seconds elapsed
uint64_t
kMicrosInSecond
=
1000
*
1000
;
auto
secs_elapsed
=
(
env_
->
NowMicros
()
-
time_started
+
kMicrosInSecond
/
2
)
/
kMicrosInSecond
;
...
...
trace_replay/block_cache_tracer.h
浏览文件 @
917c8a8b
...
...
@@ -11,7 +11,6 @@
#include "rocksdb/env.h"
#include "rocksdb/options.h"
#include "rocksdb/trace_reader_writer.h"
#include "table/table_reader_caller.h"
#include "util/trace_replay.h"
namespace
rocksdb
{
...
...
util/timer.h
浏览文件 @
917c8a8b
...
...
@@ -16,6 +16,7 @@
#include "monitoring/instrumented_mutex.h"
#include "rocksdb/env.h"
#include "util/mutexlock.h"
#include "util/sync_point_impl.h"
namespace
rocksdb
{
...
...
util/timer_test.cc
浏览文件 @
917c8a8b
...
...
@@ -354,8 +354,6 @@ TEST_F(TimerTest, ShutdownRunningTask) {
control_thr
.
join
();
delete
value
;
}
<<<<<<<
Updated
upstream
=======
TEST_F
(
TimerTest
,
AddSameFuncNameTest
)
{
mock_env_
->
set_current_time
(
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录