{"action":"created","comment":{"url":"https://api.github.com/repos/Instrumental/Instrumental.NET/pulls/comments/60247952","id":60247952,"diff_hunk":"@@ -0,0 +1,102 @@\n+namespace Instrumental\n+{\n+  using System;\n+  using System.IO;\n+  using NUnit.Framework;\n+\n+\n+  [TestFixture]\n+  public class AgentTest\n+  {\n+    private static DateTime pastEventTime = DateTime.Now.AddMinutes(-15);\n+    private static string testKey = GetTestKey();\n+\n+    private static string GetTestKey()\n+    {\n+      return File.ReadAllText(\"../testkey\");\n+    }\n+\n+    [Test]\n+    public void TestGauge()\n+    {\n+      var agent = new Agent(testKey);\n+      agent.Gauge(\"csharp.TestGauge\", 1.0f);\n+    }\n+\n+    [Test]\n+    public void TestIncrement()\n+    {\n+      var agent = new Agent(testKey);\n+      agent.Increment(\"csharp.TestIncrement\");\n+    }\n+\n+    [Test]\n+    public void TestTime()\n+    {\n+      var agent = new Agent(testKey);\n+      agent.Time(\"csharp.TestTime\", () => { System.Threading.Thread.Sleep(100); });\n+    }\n+\n+    [Test]\n+    public void TestTimeMs()\n+    {\n+      var agent = new Agent(testKey);\n+      agent.TimeMs(\"csharp.TestTimeMs\", () => { System.Threading.Thread.Sleep(100); });\n+    }\n+\n+    [Test]\n+    public void TestNotice()\n+    {\n+      var agent = new Agent(testKey);\n+      agent.Notice(\"C# test notice please ignore.\");\n+    }\n+\n+    [Test]\n+    public void TestGaugeAtATime()\n+    {\n+      var agent = new Agent(testKey);\n+      agent.Gauge(\"csharp.TestGaugePast\", 1.0f, pastEventTime);\n+    }\n+\n+    [Test]\n+    public void TestIncrementAtATime()\n+    {\n+      var agent = new Agent(testKey);\n+      agent.Increment(\"csharp.TestIncrementPast\", 13, pastEventTime);\n+    }\n+\n+    [Test]\n+    public void TestNoticeAtATime()\n+    {\n+      var agent = new Agent(testKey);\n+      agent.Notice(\"C# test notice FROM THE PAST please ignore.\", 300, pastEventTime);\n+    }\n+\n+    [Test]\n+    public void TestEnabled()\n+    {\n+      // This test tests only that a message does not end up in the queue when agent is disabled\n+      // It is possible that the message was just enqueued and dequeued so quickly that the message count\n+      // was still zero\n+      var agent = new Agent(testKey);\n+      agent.Enabled = false;\n+      agent.Increment(\"csharp.YouShouldNotSeeThisMetric\");\n+      Assert.AreEqual(0, agent.MessageCount, \"Disabled agent still queued a message\");\n+    }\n+\n+    [Test]\n+    public void TestNonBlocking()\n+\t\t{","path":"test/AgentTest.cs","position":89,"original_position":89,"commit_id":"f4d03493723ad8137146b665172dd9dec179e90d","original_commit_id":"f4d03493723ad8137146b665172dd9dec179e90d","user":{"login":"janxious","id":50124,"avatar_url":"https://avatars.githubusercontent.com/u/50124?v=3","gravatar_id":"","url":"https://api.github.com/users/janxious","html_url":"https://github.com/janxious","followers_url":"https://api.github.com/users/janxious/followers","following_url":"https://api.github.com/users/janxious/following{/other_user}","gists_url":"https://api.github.com/users/janxious/gists{/gist_id}","starred_url":"https://api.github.com/users/janxious/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janxious/subscriptions","organizations_url":"https://api.github.com/users/janxious/orgs","repos_url":"https://api.github.com/users/janxious/repos","events_url":"https://api.github.com/users/janxious/events{/privacy}","received_events_url":"https://api.github.com/users/janxious/received_events","type":"User","site_admin":false},"body":"It looks like some tabs happened?","created_at":"2016-04-19T15:03:29Z","updated_at":"2016-04-19T15:03:29Z","html_url":"https://github.com/Instrumental/Instrumental.NET/pull/2#discussion_r60247952","pull_request_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/Instrumental/Instrumental.NET/pulls/comments/60247952"},"html":{"href":"https://github.com/Instrumental/Instrumental.NET/pull/2#discussion_r60247952"},"pull_request":{"href":"https://api.github.com/repos/Instrumental/Instrumental.NET/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/Instrumental/Instrumental.NET/pulls/2","id":66932013,"html_url":"https://github.com/Instrumental/Instrumental.NET/pull/2","diff_url":"https://github.com/Instrumental/Instrumental.NET/pull/2.diff","patch_url":"https://github.com/Instrumental/Instrumental.NET/pull/2.patch","issue_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/issues/2","number":2,"state":"open","locked":false,"title":"Add Tests to the project","user":{"login":"mediocretes","id":149895,"avatar_url":"https://avatars.githubusercontent.com/u/149895?v=3","gravatar_id":"","url":"https://api.github.com/users/mediocretes","html_url":"https://github.com/mediocretes","followers_url":"https://api.github.com/users/mediocretes/followers","following_url":"https://api.github.com/users/mediocretes/following{/other_user}","gists_url":"https://api.github.com/users/mediocretes/gists{/gist_id}","starred_url":"https://api.github.com/users/mediocretes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediocretes/subscriptions","organizations_url":"https://api.github.com/users/mediocretes/orgs","repos_url":"https://api.github.com/users/mediocretes/repos","events_url":"https://api.github.com/users/mediocretes/events{/privacy}","received_events_url":"https://api.github.com/users/mediocretes/received_events","type":"User","site_admin":false},"body":"Adds basic tests to the project\r\n\r\nYou will need to add a file called \"testkey\" to the root of the project directory, which contains the API key for a project in Instrumental.  Execute the tests with script/test and your test metrics should appear in that project.","created_at":"2016-04-18T22:22:07Z","updated_at":"2016-04-19T15:03:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"95106f4988e98e9c60b012d756c2507d4148e666","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/pulls/2/commits","review_comments_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/pulls/2/comments","review_comment_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/issues/2/comments","statuses_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/statuses/f4d03493723ad8137146b665172dd9dec179e90d","head":{"label":"Instrumental:tests","ref":"tests","sha":"f4d03493723ad8137146b665172dd9dec179e90d","user":{"login":"Instrumental","id":17914730,"avatar_url":"https://avatars.githubusercontent.com/u/17914730?v=3","gravatar_id":"","url":"https://api.github.com/users/Instrumental","html_url":"https://github.com/Instrumental","followers_url":"https://api.github.com/users/Instrumental/followers","following_url":"https://api.github.com/users/Instrumental/following{/other_user}","gists_url":"https://api.github.com/users/Instrumental/gists{/gist_id}","starred_url":"https://api.github.com/users/Instrumental/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Instrumental/subscriptions","organizations_url":"https://api.github.com/users/Instrumental/orgs","repos_url":"https://api.github.com/users/Instrumental/repos","events_url":"https://api.github.com/users/Instrumental/events{/privacy}","received_events_url":"https://api.github.com/users/Instrumental/received_events","type":"Organization","site_admin":false},"repo":{"id":20925133,"name":"Instrumental.NET","full_name":"Instrumental/Instrumental.NET","owner":{"login":"Instrumental","id":17914730,"avatar_url":"https://avatars.githubusercontent.com/u/17914730?v=3","gravatar_id":"","url":"https://api.github.com/users/Instrumental","html_url":"https://github.com/Instrumental","followers_url":"https://api.github.com/users/Instrumental/followers","following_url":"https://api.github.com/users/Instrumental/following{/other_user}","gists_url":"https://api.github.com/users/Instrumental/gists{/gist_id}","starred_url":"https://api.github.com/users/Instrumental/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Instrumental/subscriptions","organizations_url":"https://api.github.com/users/Instrumental/orgs","repos_url":"https://api.github.com/users/Instrumental/repos","events_url":"https://api.github.com/users/Instrumental/events{/privacy}","received_events_url":"https://api.github.com/users/Instrumental/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Instrumental/Instrumental.NET","description":"C# agent library for the Instrumental logging service","fork":true,"url":"https://api.github.com/repos/Instrumental/Instrumental.NET","forks_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/forks","keys_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/teams","hooks_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/hooks","issue_events_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/issues/events{/number}","events_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/events","assignees_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/assignees{/user}","branches_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/branches{/branch}","tags_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/tags","blobs_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/git/refs{/sha}","trees_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/statuses/{sha}","languages_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/languages","stargazers_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/stargazers","contributors_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/contributors","subscribers_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/subscribers","subscription_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/subscription","commits_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/commits{/sha}","git_commits_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/git/commits{/sha}","comments_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/comments{/number}","issue_comment_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/issues/comments{/number}","contents_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/contents/{+path}","compare_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/merges","archive_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/downloads","issues_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/issues{/number}","pulls_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/pulls{/number}","milestones_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/milestones{/number}","notifications_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/labels{/name}","releases_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/releases{/id}","deployments_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/deployments","created_at":"2014-06-17T13:47:58Z","updated_at":"2016-04-17T19:31:03Z","pushed_at":"2016-04-18T22:22:07Z","git_url":"git://github.com/Instrumental/Instrumental.NET.git","ssh_url":"git@github.com:Instrumental/Instrumental.NET.git","clone_url":"https://github.com/Instrumental/Instrumental.NET.git","svn_url":"https://github.com/Instrumental/Instrumental.NET","homepage":null,"size":1475,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"Instrumental:build_process","ref":"build_process","sha":"4a14676f0923600e4a0593e86c7df43f61fb6f33","user":{"login":"Instrumental","id":17914730,"avatar_url":"https://avatars.githubusercontent.com/u/17914730?v=3","gravatar_id":"","url":"https://api.github.com/users/Instrumental","html_url":"https://github.com/Instrumental","followers_url":"https://api.github.com/users/Instrumental/followers","following_url":"https://api.github.com/users/Instrumental/following{/other_user}","gists_url":"https://api.github.com/users/Instrumental/gists{/gist_id}","starred_url":"https://api.github.com/users/Instrumental/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Instrumental/subscriptions","organizations_url":"https://api.github.com/users/Instrumental/orgs","repos_url":"https://api.github.com/users/Instrumental/repos","events_url":"https://api.github.com/users/Instrumental/events{/privacy}","received_events_url":"https://api.github.com/users/Instrumental/received_events","type":"Organization","site_admin":false},"repo":{"id":20925133,"name":"Instrumental.NET","full_name":"Instrumental/Instrumental.NET","owner":{"login":"Instrumental","id":17914730,"avatar_url":"https://avatars.githubusercontent.com/u/17914730?v=3","gravatar_id":"","url":"https://api.github.com/users/Instrumental","html_url":"https://github.com/Instrumental","followers_url":"https://api.github.com/users/Instrumental/followers","following_url":"https://api.github.com/users/Instrumental/following{/other_user}","gists_url":"https://api.github.com/users/Instrumental/gists{/gist_id}","starred_url":"https://api.github.com/users/Instrumental/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Instrumental/subscriptions","organizations_url":"https://api.github.com/users/Instrumental/orgs","repos_url":"https://api.github.com/users/Instrumental/repos","events_url":"https://api.github.com/users/Instrumental/events{/privacy}","received_events_url":"https://api.github.com/users/Instrumental/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Instrumental/Instrumental.NET","description":"C# agent library for the Instrumental logging service","fork":true,"url":"https://api.github.com/repos/Instrumental/Instrumental.NET","forks_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/forks","keys_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/teams","hooks_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/hooks","issue_events_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/issues/events{/number}","events_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/events","assignees_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/assignees{/user}","branches_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/branches{/branch}","tags_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/tags","blobs_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/git/refs{/sha}","trees_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/statuses/{sha}","languages_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/languages","stargazers_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/stargazers","contributors_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/contributors","subscribers_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/subscribers","subscription_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/subscription","commits_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/commits{/sha}","git_commits_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/git/commits{/sha}","comments_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/comments{/number}","issue_comment_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/issues/comments{/number}","contents_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/contents/{+path}","compare_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/merges","archive_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/downloads","issues_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/issues{/number}","pulls_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/pulls{/number}","milestones_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/milestones{/number}","notifications_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/labels{/name}","releases_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/releases{/id}","deployments_url":"https://api.github.com/repos/Instrumental/Instrumental.NET/deployments","created_at":"2014-06-17T13:47:58Z","updated_at":"2016-04-17T19:31:03Z","pushed_at":"2016-04-18T22:22:07Z","git_url":"git://github.com/Instrumental/Instrumental.NET.git","ssh_url":"git@github.com:Instrumental/Instrumental.NET.git","clone_url":"https://github.com/Instrumental/Instrumental.NET.git","svn_url":"https://github.com/Instrumental/Instrumental.NET","homepage":null,"size":1475,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Instrumental/Instrumental.NET/pulls/2"},"html":{"href":"https://github.com/Instrumental/Instrumental.NET/pull/2"},"issue":{"href":"https://api.github.com/repos/Instrumental/Instrumental.NET/issues/2"},"comments":{"href":"https://api.github.com/repos/Instrumental/Instrumental.NET/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/Instrumental/Instrumental.NET/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/Instrumental/Instrumental.NET/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Instrumental/Instrumental.NET/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/Instrumental/Instrumental.NET/statuses/f4d03493723ad8137146b665172dd9dec179e90d"}}}}