Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CP-45226: Added friendly name for new datasource 'hostload' #3243

Merged
merged 2 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions XenAdmin/Dialogs/GraphDetailsDialog.Designer.cs

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

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
Loading