Skip to content

Commit 0300399

Browse files
committed
add ingest metrics
1 parent 6177fd0 commit 0300399

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

app/config/mrt/query/query.sql.init.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ queries:
88
sql: |
99
insert into inv.inv_nodes(
1010
number,
11+
description,
1112
media_type,
1213
media_connectivity,
1314
access_mode,
@@ -22,6 +23,7 @@ queries:
2223
)
2324
select
2425
7777,
26+
'7777',
2527
'magnetic-disk',
2628
'cloud',
2729
'on-line',
@@ -36,6 +38,7 @@ queries:
3638
union
3739
select
3840
8888,
41+
'8888',
3942
'magnetic-disk',
4043
'cloud',
4144
'on-line',

app/config/mrt/query/query.sql.misc.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,4 +196,13 @@ queries:
196196
0 as audit_online_file_count,
197197
0 as audit_online_bytes_count,
198198
0 as audit_nearline_file_count
199-
where not exists (select 1 from node_counts)
199+
where not exists (select 1 from node_counts)
200+
/queries/misc/ingest-metrics:
201+
non_report: true
202+
sql: |
203+
select
204+
ifnull(sum(billable_size), 0) as ingest_bytes_count
205+
from
206+
inv.inv_files
207+
where
208+
created > date_add(now(), interval -10 minute)

app/lib/routes/services.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,7 @@ def self.registered(app)
581581
audit_online_file_count = 0
582582
audit_online_bytes_count = 0
583583
audit_nearline_file_count = 0
584+
ingest_bytes_count = 0
584585

585586
UC3Query::QueryClient.client.run_query(
586587
'/queries/misc/outstanding-replication'
@@ -604,7 +605,10 @@ def self.registered(app)
604605
audit_nearline_file_count: audit_nearline_file_count,
605606
oldest_audit_in_days: UC3Query::QueryClient.client.run_query_get_val(
606607
'/queries/misc/oldest-audit-in-days', 'days_since_today'
607-
)
608+
),
609+
gb_ingested: (UC3Query::QueryClient.client.run_query_get_val(
610+
'/queries/misc/ingest-metrics', 'ingest_bytes_count'
611+
) / 10_000_000).to_i / 100.0
608612
})
609613

610614
metrics.to_json

0 commit comments

Comments
 (0)