jiridanek commented on a change in pull request #696:
URL: https://github.com/apache/qpid-dispatch/pull/696#discussion_r430338909



##########
File path: src/http-libwebsockets.c
##########
@@ -522,11 +611,35 @@ static bool write_stats(uint8_t **position, const uint8_t 
* const end, const cha
     }
 }
 
+static bool write_allocator_stats(uint8_t **position, const uint8_t * const 
end, const char* name, allocator_field field)
+{
+    //18 chars + 2*name + 2*(field+6) + 20 chars for int
+    size_t length = 18 + strlen(name)*2 + strlen(field.name)*2 + 20;
+    if (end - *position >= length) {
+        *position += lws_snprintf((char*) *position, end - *position, "# TYPE 
%s:%s_bytes gauge\n", name, field.name);
+        *position += lws_snprintf((char*) *position, end - *position, 
"%s:%s_bytes %lu\n", name, field.name, field.value);

Review comment:
       ```suggestion
           *position += lws_snprintf((char*) *position, end - *position, 
"%s:%s_bytes %" PRIu64 "\n", name, field.name, field.value);
   ```

##########
File path: src/http-libwebsockets.c
##########
@@ -522,11 +611,35 @@ static bool write_stats(uint8_t **position, const uint8_t 
* const end, const cha
     }
 }
 
+static bool write_allocator_stats(uint8_t **position, const uint8_t * const 
end, const char* name, allocator_field field)
+{
+    //18 chars + 2*name + 2*(field+6) + 20 chars for int
+    size_t length = 18 + strlen(name)*2 + strlen(field.name)*2 + 20;
+    if (end - *position >= length) {
+        *position += lws_snprintf((char*) *position, end - *position, "# TYPE 
%s:%s_bytes gauge\n", name, field.name);
+        *position += lws_snprintf((char*) *position, end - *position, 
"%s:%s_bytes %lu\n", name, field.name, field.value);

Review comment:
       Not all platforms define uint64_t as unsigned long int, 
https://issues.apache.org/jira/browse/DISPATCH-1669




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to