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); |
+} |