Пример #1
0
        public static void Main(string[] args)
        {
            var watcher = new DeskMetrics.Watcher();
            Console.Write("Starting...");
            if (!watcher.Start("4d47c012d9340b116a000000","0.1"))
                throw new Exception("Sorry, cant be started");
            Console.WriteLine("[ok]");

            Console.Write("Adding event...");
            watcher.TrackEvent("DeskMetricsConsole","InitialEvent");
            Console.WriteLine("[ok]");

            Console.Write("Adding event value...");
            watcher.TrackEventValue("DeskMetricsConsole","EventValue","Aha!");
            Console.WriteLine("[ok]");

            Console.Write("Adding event timed...");
            watcher.TrackEventPeriod("DeskMetricsConsole","EventValue",100,true);
            watcher.TrackEventPeriod("DeskMetricsConsole","EventValue",30,false);
            Console.WriteLine("[ok]");

            Console.Write("Adding custom data...");
            watcher.TrackCustomData("DeskMetricsConsole","CustomData");
            Console.WriteLine("[ok]");

            Console.Write("Adding custom data in real time (with cache support)...");
            watcher.TrackCustomDataR("DeskMetricsConsole","MyCustomDataInRealTime");
            Console.WriteLine("[ok]");

            Console.Write("Finishing app and sending data to DeskMetrics");
            watcher.Stop();
            Console.ReadLine();
        }
Пример #2
0
        public static void Main(string[] args)
        {
            if (args.Length != 3)
            {
                PrintUsage();
                return;
            }

            var watcher = new Watcher();
            if (args[0] == "Install")
            {
                watcher.TrackInstall(args[2],args[1]);
            }

            if (args[0] == "Uninstall")
            {
                watcher.TrackUninstall(args[2],args[1]);
            }
        }
Пример #3
0
 public StartAppJson(Watcher w)
     : base(EventType.StartApplication,w.SessionGUID.ToString())
 {
     Watcher = w;
 }