diff --git a/oximeter/impl/src/schema/codegen.rs b/oximeter/impl/src/schema/codegen.rs index c29fa2b1f5..cde67439de 100644 --- a/oximeter/impl/src/schema/codegen.rs +++ b/oximeter/impl/src/schema/codegen.rs @@ -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); } diff --git a/oximeter/impl/src/schema/mod.rs b/oximeter/impl/src/schema/mod.rs index 165e87a96b..a4a2f9c612 100644 --- a/oximeter/impl/src/schema/mod.rs +++ b/oximeter/impl/src/schema/mod.rs @@ -190,6 +190,7 @@ pub enum Units { Count, Bytes, Seconds, + Nanoseconds, } /// The schema for a timeseries. diff --git a/oximeter/oximeter/schema/virtual-machine.toml b/oximeter/oximeter/schema/virtual-machine.toml new file mode 100644 index 0000000000..3ef0da4615 --- /dev/null +++ b/oximeter/oximeter/schema/virtual-machine.toml @@ -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"