Index: dart_microlytics/example/simple.dart |
diff --git a/dart_microlytics/example/simple.dart b/dart_microlytics/example/simple.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1b0cf918b315d4fa9511a2820c8c8ff6af9ef4c4 |
--- /dev/null |
+++ b/dart_microlytics/example/simple.dart |
@@ -0,0 +1,23 @@ |
+// 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 '../lib/channels.dart'; |
ahe
2014/09/02 13:44:23
I don't think this import is correct. It should pr
lukechurch
2014/09/02 19:52:36
Done.
|
+import '../lib/io_channels.dart'; |
ahe
2014/09/02 13:44:22
Ditto.
lukechurch
2014/09/02 19:52:36
Done.
|
+import '../lib/microlytics.dart'; |
ahe
2014/09/02 13:44:23
Ditto.
lukechurch
2014/09/02 19:52:36
Done.
|
+ |
+void main() { |
+ |
ahe
2014/09/02 13:44:23
Remove extra line.
lukechurch
2014/09/02 19:52:36
Done.
|
+ // Create the channel that will be used to communicate to analytics |
ahe
2014/09/02 13:44:22
Add period.
lukechurch
2014/09/02 19:52:36
Done.
|
+ var channel = new RateLimitingBufferedChannel( |
+ new HttpClientChannel(),packetsPerSecond: 1.0); |
+ |
+ // Create the logger |
ahe
2014/09/02 13:44:22
Period.
lukechurch
2014/09/02 19:52:36
Done.
|
+ var lg = new AnalyticsLogger(channel, "555", "UA-XXXXX-X", "test", "1.2"); |
ahe
2014/09/02 13:44:23
Pass analytics ID in as command-line argument?
lukechurch
2014/09/02 19:52:36
Good suggestion - I think in this case it will onl
|
+ |
ahe
2014/09/02 13:44:23
Remove extra line.
lukechurch
2014/09/02 19:52:36
Done.
|
+ |
+ // Send some messages |
ahe
2014/09/02 13:44:23
Period.
lukechurch
2014/09/02 19:52:36
Done.
|
+ lg.logAnonymousEvent("hello", "world"); |
+ lg.logAnonymousTiming("loader", "var", 42); |
+ |
ahe
2014/09/02 13:44:23
Remove extra line.
lukechurch
2014/09/02 19:52:36
Done.
|
+} |