Metrics logging not working. Dart latest stable sdk

31 views
Skip to first unread message

Faisal Abid

unread,
Nov 9, 2015, 10:56:41 PM11/9/15
to Dart VM Observatory Discuss
I've added some Metric logging to my Dart server app, hoping to see it in Observatory's metric page, but I can't seem to get them to appear.

Pseudo code of what I'm doing is below. Hope thats clear.

Any help would be appreciated!

server.dart

class .. {
 
static Counter numAPI = new Counter("API Requests", "API Requests");


 
static startServer(int port) async {
   
Metrics.register(numAPI);


   
//setup http
   
// then on http request listener
    numAPI
.value++
 
}

}

Seth Ladd

unread,
Nov 9, 2015, 10:59:06 PM11/9/15
to Faisal Abid, Dart VM Observatory Discuss
I'm also curious, can I use the Service Protocol to query for this counter? Then I could wire it up to something like MRTG or RRDtool

--
You received this message because you are subscribed to the Google Groups "Dart VM Observatory Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to observatory-dis...@dartlang.org.

johnmccutchan

unread,
Nov 10, 2015, 11:46:21 AM11/10/15
to Dart VM Observatory Discuss
Hi,

This works for me using the latest version of Dart:

import 'dart:developer';

main() {
  Counter numAPI = new Counter("API Requests", "API Requests");
  numAPI.value++;
  Metrics.register(numAPI);

johnmccutchan

unread,
Nov 10, 2015, 11:47:10 AM11/10/15
to Dart VM Observatory Discuss, faisa...@gmail.com
Of course. Observatory uses only the service protocol to gather data.
To unsubscribe from this group and stop receiving emails from it, send an email to observatory-discuss+unsub...@dartlang.org.

Seth Ladd

unread,
Nov 10, 2015, 11:48:53 AM11/10/15
to johnmccutchan, Dart VM Observatory Discuss, Faisal Abid
On Tue, Nov 10, 2015 at 8:47 AM, johnmccutchan <johnmc...@google.com> wrote:
Of course. Observatory uses only the service protocol to gather data.


Very cool!
 
To unsubscribe from this group and stop receiving emails from it, send an email to observatory-dis...@dartlang.org.

--
You received this message because you are subscribed to the Google Groups "Dart VM Observatory Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to observatory-dis...@dartlang.org.

Reply all
Reply to author
Forward
0 new messages