Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(824)

Unified Diff: microlytics/example/simple.dart

Issue 515993003: Minimalistic analytics library used by Dart Server and try.dartlang.org (Closed) Base URL: https://github.com/lukechurch/dart-mircolytics.git@master
Patch Set: Address review comments Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: microlytics/example/simple.dart
diff --git a/microlytics/example/simple.dart b/microlytics/example/simple.dart
new file mode 100644
index 0000000000000000000000000000000000000000..c02e2aeb1755317b28b2170d64689946454a1f2d
--- /dev/null
+++ b/microlytics/example/simple.dart
@@ -0,0 +1,22 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:microlytics/channels.dart';
+import 'package:microlytics/io_channels.dart';
+import 'package:microlytics/microlytics.dart';
+
+void main() {
+ // Create the channel that will be used to communicate to analytics.
+ var channel = new RateLimitingBufferedChannel(
+ new HttpClientChannel(),packetsPerSecond: 1.0);
ahe 2014/09/03 08:51:31 Add space before packetsPerSecond.
lukechurch 2014/09/04 12:58:41 Done.
+
+ const String CLIENT_ID = "UA-XXXXXXXX-1"; //Replace this with your client ID
ahe 2014/09/03 08:51:31 In Dart, it is possible to define compile-time con
lukechurch 2014/09/04 12:58:41 Done.
+
+ // Create the logger.
+ var lg = new AnalyticsLogger(channel, "555", CLIENT_ID, "test", "1.2");
+
+ // Send some messages.
+ lg.logAnonymousEvent("hello", "world");
+ lg.logAnonymousTiming("loader", "var", 42);
+}

Powered by Google App Engine
This is Rietveld 408576698