Skip to content

Commit 1135047

Browse files
authored
Move VM vCPU timeseries to TOML (#6035)
1 parent 5671cd5 commit 1135047

File tree

4 files changed

+71
-1
lines changed

4 files changed

+71
-1
lines changed

openapi/nexus.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19800,7 +19800,8 @@
1980019800
"enum": [
1980119801
"count",
1980219802
"bytes",
19803-
"seconds"
19803+
"seconds",
19804+
"nanoseconds"
1980419805
]
1980519806
},
1980619807
"User": {

oximeter/impl/src/schema/codegen.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,9 @@ impl quote::ToTokens for Units {
518518
Units::Count => quote! { ::oximeter::schema::Units::Count },
519519
Units::Bytes => quote! { ::oximeter::schema::Units::Bytes },
520520
Units::Seconds => quote! { ::oximeter::schema::Units::Seconds },
521+
Units::Nanoseconds => {
522+
quote! { ::oximeter::schema::Units::Nanoseconds }
523+
}
521524
};
522525
toks.to_tokens(tokens);
523526
}

oximeter/impl/src/schema/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ pub enum Units {
190190
Count,
191191
Bytes,
192192
Seconds,
193+
Nanoseconds,
193194
}
194195

195196
/// The schema for a timeseries.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
format_version = 1
2+
3+
[target]
4+
name = "virtual_machine"
5+
description = "A guest virtual machine instance"
6+
authz_scope = "project"
7+
versions = [
8+
{ version = 1, fields = [ "instance_id", "project_id", "silo_id" ] },
9+
]
10+
11+
[[metrics]]
12+
name = "vcpu_usage"
13+
description = "Cumulative time each vCPU has spent in a state"
14+
units = "nanoseconds"
15+
datum_type = "cumulative_u64"
16+
versions = [
17+
{ added_in = 1, fields = [ "state", "vcpu_id" ] }
18+
]
19+
20+
[[metrics]]
21+
name = "reset"
22+
description = "Cumulative number of times the virtual machine has been reset"
23+
units = "count"
24+
datum_type = "cumulative_u64"
25+
versions = [
26+
{ added_in = 1, fields = [ ] }
27+
]
28+
29+
[[metrics]]
30+
name = "pv_panic_guest_handled"
31+
description = "Cumulative number of times a PVPANIC event was handled by the guest"
32+
units = "count"
33+
datum_type = "cumulative_u64"
34+
versions = [
35+
{ added_in = 1, fields = [ ] }
36+
]
37+
38+
[[metrics]]
39+
name = "pv_panic_host_handled"
40+
description = "Cumulative number of times a PVPANIC event was handled by the host"
41+
units = "count"
42+
datum_type = "cumulative_u64"
43+
versions = [
44+
{ added_in = 1, fields = [ ] }
45+
]
46+
47+
[fields.instance_id]
48+
type = "uuid"
49+
description = "ID of the virtual machine instance"
50+
51+
[fields.project_id]
52+
type = "uuid"
53+
description = "ID of the virtual machine instance's project"
54+
55+
[fields.silo_id]
56+
type = "uuid"
57+
description = "ID of the virtual machine instance's silo"
58+
59+
[fields.state]
60+
type = "string"
61+
description = "The state of the vCPU"
62+
63+
[fields.vcpu_id]
64+
type = "u32"
65+
description = "The ID of the vCPU"

0 commit comments

Comments
 (0)