stricklandrbls commented on code in PR #993:
URL: https://github.com/apache/daffodil-vscode/pull/993#discussion_r1534177234


##########
src/svelte/src/components/ServerMetrics/ServerMetrics.svelte:
##########
@@ -107,32 +107,49 @@ limitations under the License.
         on:mouseenter={() => showHeartbeatInfo(true)}
         on:mouseleave={() => showHeartbeatInfo(false)}
       >
-        {#if heartbeat.latency < 20}
+        {#if 0 < heartbeat.latency && heartbeat.latency < 20}
           <circle cx="50%" cy="50%" r="4pt" fill="green" />
-        {:else if heartbeat.latency < 40}
+        {:else if 0 < heartbeat.latency && heartbeat.latency < 40}
           <circle cx="50%" cy="50%" r="4pt" fill="yellow" />
-        {:else if heartbeat.latency > 60}
+        {:else if 0 < heartbeat.latency && heartbeat.latency > 60}
           <circle cx="50%" cy="50%" r="4pt" fill="red" />
         {:else}
           <circle cx="50%" cy="50%" r="4pt" fill="grey" />
         {/if}
       </svg>
       <div class="heartbeat-info">
-        <b>Latency:</b>
-        {heartbeat.latency}ms,
-        <b>CPU Load Avg:</b>
-        {(heartbeat.serverCpuLoadAverage
-          ? heartbeat.serverCpuLoadAverage
-          : 0
-        ).toFixed(2)},
-        <b>Memory Usage:</b>
-        {heartbeat.serverUsedMemory},
-        <b>Session Count:</b>
-        {heartbeat.sessionCount},
-        <b>Uptime:</b>
-        {prettyPrintUptime(heartbeat.serverUptime)}
-        <b>JVM Version:</b>
-        {heartbeat.jvmVersion}
+        {#if heartbeat.latency > 0}
+          <b>Latency:</b>
+          {heartbeat.latency}ms,
+        {/if}
+        {#if heartbeat.serverUptime > 0}
+          <b>Uptime:</b>
+          {prettyPrintUptime(heartbeat.serverUptime)}
+        {/if}
+        {#if heartbeat.sessionCount > 0}
+          <b>Session Count:</b>
+          {heartbeat.sessionCount},
+        {/if}
+        {#if heartbeat.serverCpuLoadAverage > 0}

Review Comment:
   > I wanted to avoid placeholders simply due to (lack of) real estate.
   
   The using `humanReadableByteLength(byteLength: number): string ` from 
`./src/svelte/src/utilities/display.ts` on the "Memory Usage" value might help 
with the real estate. I'm be fine approving this PR with omitting the 
`CPULoadAverage` value for Windows and possibly creating another ticket for 
restructuring the way server information is output.



-- 
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