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

Unified Diff: dart/pkg/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
« no previous file with comments | « no previous file | dart/pkg/microlytics/lib/channels.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/pkg/microlytics/example/simple.dart
diff --git a/dart/pkg/microlytics/example/simple.dart b/dart/pkg/microlytics/example/simple.dart
new file mode 100644
index 0000000000000000000000000000000000000000..b0b6792fc3b1b5387b996e88a21576d126fd01ff
--- /dev/null
+++ b/dart/pkg/microlytics/example/simple.dart
@@ -0,0 +1,26 @@
+// 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(List<String> arguments) {
+ // Create the channel that will be used to communicate to analytics.
+ var channel = new RateLimitingBufferedChannel(
+ new HttpClientChannel(), packetsPerSecond: 1.0);
+
+ if (arguments.length != 1) {
+ print("usage: dart simple.dart GA-Client-ID");
+ return;
+ }
+ final String clientID = arguments.single;
+
+ // Create the logger.
+ var lg = new AnalyticsLogger(channel, "555", clientID, "test", "1.2");
+
+ // Send some messages.
+ lg.logAnonymousEvent("hello", "world");
+ lg.logAnonymousTiming("loader", "var", 42);
+}
« no previous file with comments | « no previous file | dart/pkg/microlytics/lib/channels.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698