Skip to content

Commit

Permalink
Move VM vCPU timeseries to TOML
Browse files Browse the repository at this point in the history
  • Loading branch information
bnaecker committed Jul 10, 2024
1 parent 7cbb741 commit 955075c
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
3 changes: 3 additions & 0 deletions oximeter/impl/src/schema/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,9 @@ impl quote::ToTokens for Units {
Units::Count => quote! { ::oximeter::schema::Units::Count },
Units::Bytes => quote! { ::oximeter::schema::Units::Bytes },
Units::Seconds => quote! { ::oximeter::schema::Units::Seconds },
Units::Nanoseconds => {
quote! { ::oximeter::schema::Units::Nanoseconds }
}
};
toks.to_tokens(tokens);
}
Expand Down
1 change: 1 addition & 0 deletions oximeter/impl/src/schema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ pub enum Units {
Count,
Bytes,
Seconds,
Nanoseconds,
}

/// The schema for a timeseries.
Expand Down
65 changes: 65 additions & 0 deletions oximeter/oximeter/schema/virtual-machine.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
format_version = 1

[target]
name = "virtual_machine"
description = "A guest virtual machine instance"
authz_scope = "project"
versions = [
{ version = 1, fields = [ "instance_id", "project_id", "silo_id" ] },
]

[[metrics]]
name = "vcpu_usage"
description = "Cumulative time each vCPU has spent in a state"
units = "nanoseconds"
datum_type = "cumulative_u64"
versions = [
{ added_in = 1, fields = [ "state", "vcpu_id" ] }
]

[[metrics]]
name = "reset"
description = "Cumulative number of times the virtual machine has been reset"
units = "count"
datum_type = "cumulative_u64"
versions = [
{ added_in = 1, fields = [ ] }
]

[[metrics]]
name = "pv_panic_guest_handled"
description = "Cumulative number of times a PVPANIC event was handled by the guest"
units = "count"
datum_type = "cumulative_u64"
versions = [
{ added_in = 1, fields = [ ] }
]

[[metrics]]
name = "pv_panic_host_handled"
description = "Cumulative number of times a PVPANIC event was handled by the host"
units = "count"
datum_type = "cumulative_u64"
versions = [
{ added_in = 1, fields = [ ] }
]

[fields.instance_id]
type = "uuid"
description = "ID of the virtual machine instance"

[fields.project_id]
type = "uuid"
description = "ID of the virtual machine instance's project"

[fields.silo_id]
type = "uuid"
description = "ID of the virtual machine instance's silo"

[fields.state]
type = "string"
description = "The state of the vCPU"

[fields.vcpu_id]
type = "u32"
description = "The ID of the vCPU"

0 comments on commit 955075c

Please sign in to comment.