Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New metric to observe the thread cache size #1558

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions collector/lib/CollectorStatsExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ void CollectorStatsExporter::run() {
auto& preemptions = collectorEventCounters.Add({{"type", "preemptions"}});
auto& userspaceEvents = collectorEventCounters.Add({{"type", "userspace"}});
auto& grpcSendFailures = collectorEventCounters.Add({{"type", "grpcSendFailures"}});
auto& threadTableSize = collectorEventCounters.Add({{"type", "threadCacheSize"}});

auto& processSent = collectorEventCounters.Add({{"type", "processSent"}});
auto& processSendFailures = collectorEventCounters.Add({{"type", "processSendFailures"}});
Expand Down Expand Up @@ -213,6 +214,7 @@ void CollectorStatsExporter::run() {
kernel.Set(stats.nEvents);
drops.Set(stats.nDrops);
preemptions.Set(stats.nPreemptions);
threadTableSize.Set(stats.nThreadCacheSize);

uint64_t nUserspace = 0;
for (int i = 0; i < PPM_EVENT_MAX; i++) {
Expand Down
1 change: 1 addition & 0 deletions collector/lib/Sysdig.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ struct SysdigStats {
volatile uint64_t nFilteredEvents[PPM_EVENT_MAX] = {0}; // events post filtering
volatile uint64_t nUserspaceEvents[PPM_EVENT_MAX] = {0}; // events processed by userspace
volatile uint64_t nGRPCSendFailures = 0; // number of signals that were not sent on GRPC
volatile uint64_t nThreadCacheSize = 0; // number of thread-info entries stored in the cache

// process related metrics
volatile uint64_t nProcessSent = 0; // number of process signals sent
Expand Down
1 change: 1 addition & 0 deletions collector/lib/SysdigService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ bool SysdigService::GetStats(SysdigStats* stats) const {
stats->nEvents = kernel_stats.n_evts;
stats->nDrops = kernel_stats.n_drops;
stats->nPreemptions = kernel_stats.n_preemptions;
stats->nThreadCacheSize = inspector_->m_thread_manager->get_thread_count();

return true;
}
Expand Down
1 change: 1 addition & 0 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ Units: occurence
| preemptions | Number of preemptions (?) |
| userspace[syscall] | Number of this kind of event |
| grpcSendFailures | (not used?) |
| threadCacheSize | Number of thread-info entries stored in the thread cache (sampled every 5s) |
| processSent | Process signal sent with success |
| processSendFailures | Failure upon sending a process signal |
| processResolutionFailuresByEvt | Count of invalid process signal events received, then ignored (invalid path or name, or not execve) |
Expand Down
Loading