Skip to content

Commit

Permalink
Add disk io metrics for document type.
Browse files Browse the repository at this point in the history
  • Loading branch information
toregge committed Nov 15, 2024
1 parent 75783d3 commit 46f0ad4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ DocumentDBTaggedMetrics::IndexMetrics::IndexMetrics(MetricSet *parent)
: MetricSet("index", {}, "Index metrics (memory and disk) for this document db", parent),
diskUsage("disk_usage", {}, "Disk space usage in bytes", this),
memoryUsage(this),
docsInMemory("docs_in_memory", {}, "Number of documents in memory index", this)
docsInMemory("docs_in_memory", {}, "Number of documents in memory index", this),
disk_io(this)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ struct DocumentDBTaggedMetrics : metrics::MetricSet
metrics::LongValueMetric diskUsage;
MemoryUsageMetrics memoryUsage;
metrics::LongValueMetric docsInMemory;
DiskIoMetrics disk_io;

IndexMetrics(metrics::MetricSet *parent);
~IndexMetrics() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,17 @@ updateIndexMetrics(DocumentDBTaggedMetrics &metrics, const search::SearchableSta
updateMemoryUsageMetrics(indexMetrics.memoryUsage, stats.memoryUsage(), totalStats);
indexMetrics.docsInMemory.set(stats.docsInMemory());
auto& field_metrics = metrics.ready.index;
search::CacheDiskIoStats disk_io;
for (auto& field : stats.get_field_stats()) {
auto entry = field_metrics.get_field_metrics_entry(field.first);
if (entry) {
entry->memoryUsage.update(field.second.memory_usage());
entry->size_on_disk.set(field.second.size_on_disk());
entry->update_disk_io(field.second.cache_disk_io_stats());
}
disk_io.merge(field.second.cache_disk_io_stats());
}
indexMetrics.disk_io.update(disk_io);
}

struct TempAttributeMetric
Expand Down

0 comments on commit 46f0ad4

Please sign in to comment.