MKehayov commented on code in PR #1641:
URL: https://github.com/apache/systemds/pull/1641#discussion_r906695566


##########
src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/NodeEntityModel.java:
##########
@@ -68,13 +83,43 @@ public void setStats(final List<BaseEntityModel> stats) {
                _stats = stats;
        }
 
+       public double getJitCompileTime() {
+               return _jitCompileTime;
+       }
+
+       public void setJitCompileTime(final double jitCompileTime) {
+               _jitCompileTime = jitCompileTime;
+       }
+
+       public String getRequestTypeCount() {
+               List<String> requestTypeCountStrArr = new ArrayList<>();
+
+               if (_requestTypeCount != null) {
+                       for(var entry : _requestTypeCount) {
+                               requestTypeCountStrArr.add(String.format("{" +
+                                               "\"type\": \"%s\"," +
+                                               "\"count\": %d" +
+                                               "}", 
entry.getLeft().toString(), entry.getRight()));
+                       }
+               }
+
+               return String.join(",", requestTypeCountStrArr);
+       }
+
+       public void setRequestTypeCount(final 
List<Pair<FederatedRequest.RequestType, Long>> requestTypeCount) {
+               _requestTypeCount = requestTypeCount;
+       }
+
        @Override
        public String toString() {
                return String.format("{" +
                                "\"id\": %d," +
                                "\"name\": \"%s\"," +
                                "\"address\": \"%s\"," +
+                               "\"isOnline\": %b," +
+                               "\"jitCompileTime\": %.2f," +

Review Comment:
   Same, moved logic into a separate file.



##########
src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/StatsEntityModel.java:
##########
@@ -74,25 +97,33 @@ public double getMemoryUsage() {
        public void setMemoryUsage(final double memoryUsage) {
                _memoryUsage = memoryUsage;
        }
+       public double getJitCompileTime() {
+               return _jitCompileTime;
+       }
+
+       public List<Pair<FederatedRequest.RequestType, Long>> 
getRequestTypeCount() {
+               return _requestTypeCount;
+       }
 
        public String getHeavyHitterInstructions() {
-               if (_heavyHitterInstructions.isEmpty() || 
_heavyHitterInstructions.isBlank()) {
-                       StringBuilder sb = new StringBuilder();
+               if ((_heavyHitterInstructions.isEmpty() || 
_heavyHitterInstructions.isBlank()) && _heavyHitterInstructionsObj != null) {
+
+                       List<String> heavyHittersStrArr = new ArrayList<>();
 
-                       sb.append("{");
                        for(Map.Entry<String, Pair<Long, Double>> entry : 
_heavyHitterInstructionsObj.entrySet()) {
                                String instruction = entry.getKey();
                                Long count = entry.getValue().getLeft();
                                double duration = entry.getValue().getRight();
-                               sb.append(String.format("{" +
-                                       "\"instruction\": %s," +
-                                       "\"count\": \"%d\"," +
-                                       "\"duration\": \"%.2f\"," +
-                                       "},", instruction, count, duration));
+                               heavyHittersStrArr.add(String.format("{" +
+                                       "\"instruction\": \"%s\"," +

Review Comment:
   Done, moved logic into a separate file.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to