Skip to content

Commit

Permalink
CP-45226: Added friendly name for new datasource 'hostload'.
Browse files Browse the repository at this point in the history
Signed-off-by: Konstantina Chremmou <[email protected]>
  • Loading branch information
kc284 committed Oct 25, 2023
1 parent f7c9d43 commit fb9383d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions XenModel/FriendlyNames.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions XenModel/FriendlyNames.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1856,6 +1856,9 @@
<data name="Message.name-wlb_vm_relocation" xml:space="preserve">
<value>WLB VM Relocation</value>
</data>
<data name="OPERATIONAL_METRICS_HOSTLOAD" xml:space="preserve">
<value>Host CPU Load</value>
</data>
<data name="PREPARE_HOST_UPGRADE_ERROR_PREPARING_HOST" xml:space="preserve">
<value>There was an error in preparing the host for upgrade.</value>
</data>
Expand Down
7 changes: 7 additions & 0 deletions XenModel/Utils/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,7 @@ public static string ToStringI18N(this DataSourceCategory category)
static Regex XapiMemoryRegex = new Regex("^xapi_(allocation|free_memory|live_memory|memory_usage)_kib$");
static Regex StatefileLatencyRegex = new Regex("^statefile/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/latency$");
static Regex LoadAvgRegex = new Regex("loadavg");
static Regex HostLoadRegex = new Regex("hostload");
static Regex SrRegex = new Regex("^sr_[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}_cache_(size|hits|misses)");
static Regex SrIORegex = new Regex("^(io_throughput|iops)_(read|write|total)_([a-f0-9]{8})$");
static Regex SrOtherRegex = new Regex("^(latency|avgqu_sz|inflight|iowait)_([a-f0-9]{8})$");
Expand Down Expand Up @@ -706,6 +707,9 @@ public static DataSourceCategory GetDataSourceCategory(string name)
if (LoadAvgRegex.IsMatch(name))
return DataSourceCategory.LoadAverage;

if (HostLoadRegex.IsMatch(name))
return DataSourceCategory.LoadAverage;

if (name.StartsWith("pvsaccelerator"))
return DataSourceCategory.Pvs;

Expand Down Expand Up @@ -899,6 +903,9 @@ private static string GetFriendlyDataSourceName_(string name, IXenObject iXenObj
if (LoadAvgRegex.IsMatch(name))
return FriendlyNameManager.GetFriendlyName("Label-performance.loadavg");

if (HostLoadRegex.IsMatch(name))
return FriendlyNames.OPERATIONAL_METRICS_HOSTLOAD;

return FriendlyNameManager.GetFriendlyName(string.Format("Label-performance.{0}", name));
}

Expand Down

0 comments on commit fb9383d

Please sign in to comment.