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

Change NodeLoadMetricInformation properties from int to double #137

Merged
merged 2 commits into from
Sep 24, 2024
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
4 changes: 2 additions & 2 deletions properties/service_fabric_common.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

<!-- Version for binaries, nuget packages generated from this repo. -->
<!-- TODO: Versions numbers are changed here manually for now, Integrate this with GitVersion. -->
<MajorVersion>4</MajorVersion>
<MinorVersion>12</MinorVersion>
<MajorVersion>5</MajorVersion>
<MinorVersion>0</MinorVersion>
<BuildVersion>0</BuildVersion>
<Revision>0</Revision>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ internal static NodeLoadMetricInformation GetFromJsonProperties(JsonReader reade
var isCapacityViolation = default(bool?);
var nodeBufferedCapacity = default(string);
var nodeRemainingBufferedCapacity = default(string);
var currentNodeLoad = default(int?);
var nodeCapacityRemaining = default(int?);
var bufferedNodeCapacityRemaining = default(int?);
var plannedNodeLoadRemoval = default(int?);
var currentNodeLoad = default(double?);
var nodeCapacityRemaining = default(double?);
var bufferedNodeCapacityRemaining = default(double?);
var plannedNodeLoadRemoval = default(double?);

do
{
Expand Down Expand Up @@ -78,19 +78,19 @@ internal static NodeLoadMetricInformation GetFromJsonProperties(JsonReader reade
}
else if (string.Compare("CurrentNodeLoad", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
currentNodeLoad = reader.ReadValueAsInt();
currentNodeLoad = reader.ReadValueAsDouble();
}
else if (string.Compare("NodeCapacityRemaining", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
nodeCapacityRemaining = reader.ReadValueAsInt();
nodeCapacityRemaining = reader.ReadValueAsDouble();
}
else if (string.Compare("BufferedNodeCapacityRemaining", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
bufferedNodeCapacityRemaining = reader.ReadValueAsInt();
bufferedNodeCapacityRemaining = reader.ReadValueAsDouble();
}
else if (string.Compare("PlannedNodeLoadRemoval", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
plannedNodeLoadRemoval = reader.ReadValueAsInt();
plannedNodeLoadRemoval = reader.ReadValueAsDouble();
}
else
{
Expand Down Expand Up @@ -159,22 +159,22 @@ internal static void Serialize(JsonWriter writer, NodeLoadMetricInformation obj)

if (obj.CurrentNodeLoad != null)
{
writer.WriteProperty(obj.CurrentNodeLoad, "CurrentNodeLoad", JsonWriterExtensions.WriteIntValue);
writer.WriteProperty(obj.CurrentNodeLoad, "CurrentNodeLoad", JsonWriterExtensions.WriteDoubleValue);
}

if (obj.NodeCapacityRemaining != null)
{
writer.WriteProperty(obj.NodeCapacityRemaining, "NodeCapacityRemaining", JsonWriterExtensions.WriteIntValue);
writer.WriteProperty(obj.NodeCapacityRemaining, "NodeCapacityRemaining", JsonWriterExtensions.WriteDoubleValue);
}

if (obj.BufferedNodeCapacityRemaining != null)
{
writer.WriteProperty(obj.BufferedNodeCapacityRemaining, "BufferedNodeCapacityRemaining", JsonWriterExtensions.WriteIntValue);
writer.WriteProperty(obj.BufferedNodeCapacityRemaining, "BufferedNodeCapacityRemaining", JsonWriterExtensions.WriteDoubleValue);
}

if (obj.PlannedNodeLoadRemoval != null)
{
writer.WriteProperty(obj.PlannedNodeLoadRemoval, "PlannedNodeLoadRemoval", JsonWriterExtensions.WriteIntValue);
writer.WriteProperty(obj.PlannedNodeLoadRemoval, "PlannedNodeLoadRemoval", JsonWriterExtensions.WriteDoubleValue);
}

writer.WriteEndObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ public NodeLoadMetricInformation(
bool? isCapacityViolation = default(bool?),
string nodeBufferedCapacity = default(string),
string nodeRemainingBufferedCapacity = default(string),
int? currentNodeLoad = default(int?),
int? nodeCapacityRemaining = default(int?),
int? bufferedNodeCapacityRemaining = default(int?),
int? plannedNodeLoadRemoval = default(int?))
double? currentNodeLoad = default(double?),
double? nodeCapacityRemaining = default(double?),
double? bufferedNodeCapacityRemaining = default(double?),
double? plannedNodeLoadRemoval = default(double?))
{
this.Name = name;
this.NodeCapacity = nodeCapacity;
Expand Down Expand Up @@ -103,23 +103,23 @@ public NodeLoadMetricInformation(
/// <summary>
/// Gets current load on the node for this metric.
/// </summary>
public int? CurrentNodeLoad { get; }
public double? CurrentNodeLoad { get; }

/// <summary>
/// Gets the remaining capacity on the node for the metric.
/// </summary>
public int? NodeCapacityRemaining { get; }
public double? NodeCapacityRemaining { get; }

/// <summary>
/// Gets the remaining capacity which is not reserved by NodeBufferPercentage for this metric on the node.
/// </summary>
public int? BufferedNodeCapacityRemaining { get; }
public double? BufferedNodeCapacityRemaining { get; }

/// <summary>
/// Gets this value represents the load of the replicas that are planned to be removed in the future.
/// This kind of load is reported for replicas that are currently being moving to other nodes and for replicas that are
/// currently being dropped but still use the load on the source node.
/// </summary>
public int? PlannedNodeLoadRemoval { get; }
public double? PlannedNodeLoadRemoval { get; }
}
}