Skip to content

Commit

Permalink
add grafana
Browse files Browse the repository at this point in the history
  • Loading branch information
lidezhu committed Jun 8, 2023
1 parent 999b08d commit f33f043
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dbms/src/Common/CurrentMetrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
M(PSMVCCSnapshotsList) \
M(PSMVCCNumDelta) \
M(PSMVCCNumBase) \
M(PSWriterQueueSize) \
M(PSPendingWriterSize) \
M(RWLockWaitingReaders) \
M(RWLockWaitingWriters) \
M(RWLockActiveReaders) \
Expand Down
4 changes: 2 additions & 2 deletions dbms/src/Storages/Page/V3/PageDirectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
namespace CurrentMetrics
{
extern const Metric PSMVCCSnapshotsList;
extern const Metric PSWriterQueueSize;
extern const Metric PSPendingWriterSize;
} // namespace CurrentMetrics

namespace DB
Expand Down Expand Up @@ -1481,6 +1481,7 @@ std::unordered_set<String> PageDirectory<Trait>::apply(PageEntriesEdit && edit,
// Note that, as read threads use current `sequence` as read_seq, we cannot increase `sequence`
// before applying edit to `mvcc_table_directory`.
GET_METRIC(tiflash_storage_page_command_count, type_write).Increment();
CurrentMetrics::Increment pending_writer_size{CurrentMetrics::PSPendingWriterSize};
Writer w;
w.edit = &edit;

Expand All @@ -1492,7 +1493,6 @@ std::unordered_set<String> PageDirectory<Trait>::apply(PageEntriesEdit && edit,

writers.push_back(&w);
SYNC_FOR("after_PageDirectory::enter_write_group");
CurrentMetrics::set(CurrentMetrics::PSWriterQueueSize, writers.size());
w.cv.wait(apply_lock, [&] { return w.done || &w == writers.front(); });
GET_METRIC(tiflash_storage_page_write_duration_seconds, type_wait_in_group).Observe(watch.elapsedSeconds());
watch.restart();
Expand Down

0 comments on commit f33f043

Please sign in to comment.