{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/pulls/comments/73903472","id":73903472,"diff_hunk":"@@ -0,0 +1,170 @@\n+﻿namespace Microsoft.ApplicationInsights.DataContracts\n+{\n+    using System;\n+    using System.Collections.Generic;\n+    using Microsoft.ApplicationInsights.Channel;\n+    using Microsoft.ApplicationInsights.Extensibility.Implementation;\n+    using Microsoft.ApplicationInsights.Extensibility.Implementation.External;\n+    using System.Globalization;\n+\n+    /// <summary>\n+    /// Telemetry type used for availability test results.\n+    /// Contains a time and message and optionally some additional metadata.\n+    /// </summary>\n+    public sealed class AvailabilityTelemetry : ITelemetry, ISupportProperties //TODO: Should this implement IOperation like RequestTelemetry?\n+    {\n+        internal const string TelemetryName = \"Availability\";\n+\n+        internal readonly string BaseType = typeof(AvailabilityData).Name;\n+        internal readonly AvailabilityData Data;\n+        private readonly TelemetryContext context;\n+\n+        /// <summary>\n+        /// Initializes a new instance of the <see cref=\"AvailabilityTelemetry\"/> class with empty properties.\n+        /// </summary>\n+        public AvailabilityTelemetry()\n+        {\n+            this.Data = new AvailabilityData();\n+            this.context = new TelemetryContext(this.Data.properties);\n+            this.Data.testRunId = Guid.NewGuid().ToString();\n+        }\n+\n+        /// <summary>\n+        /// Initializes a new instance of the <see cref=\"AvailabilityTelemetry\"/> class with empty properties.\n+        /// </summary>\n+        public AvailabilityTelemetry(string testName, DateTimeOffset testTimeStamp, TimeSpan duration, string runLocation, bool success, string message = null)\n+        {\n+            this.Data = new AvailabilityData();\n+            this.context = new TelemetryContext(this.Data.properties);            \n+            this.Data.testTimeStamp = testTimeStamp.ToString(\"o\", CultureInfo.InvariantCulture);\n+            this.Data.testName = testName;\n+            this.Data.testRunId = Guid.NewGuid().ToString();\n+            this.Data.duration = duration.ToString(string.Empty, CultureInfo.InvariantCulture);\n+            this.Data.result = success ? TestResult.Pass : TestResult.Fail;\n+            this.Data.runLocation = runLocation;\n+            this.Data.message = message;           \n+        }        \n+\n+        /// <summary>\n+        /// Gets or sets the test run id guid\n+        /// </summary>\n+        public Guid Id\n+        {\n+            get { return Guid.Parse(this.Data.testRunId); }\n+            set { this.Data.testRunId = value.ToString(); }\n+        }\n+\n+        /// <summary>\n+        /// Gets or sets date and time when the availability test was executed.\n+        /// </summary>\n+        public DateTimeOffset TestTimeStamp\n+        {\n+            get { return Utils.ValidateDateTimeOffset(this.Data.testTimeStamp); }\n+            set { this.Data.testTimeStamp = value.ToString(\"o\", CultureInfo.InvariantCulture); }\n+        }\n+\n+        /// <summary>\n+        /// Gets or sets the test name.\n+        /// </summary>\n+        public string TestName\n+        {\n+            get { return this.Data.testName; }\n+            set { this.Data.testName = value; }\n+        }\n+\n+        /// <summary>\n+        /// Gets or sets availability test duration.\n+        /// </summary>\n+        public TimeSpan Duration\n+        {\n+            get\n+            {\n+                //TODO: Note: this ends up logging an error messsage for Request Telemetry if it fails, Both PageView and Request telemetry use this to validate so PV already has the bug.","path":"src/Core/Managed/Shared/DataContracts/AvailabilityTelemetry.cs","position":null,"original_position":82,"commit_id":"2b90cc8e72881402cf17ef56654acfcfc2376706","original_commit_id":"6875562304c82e7fccccb1ca35968f727a319028","user":{"login":"ericmattingly","id":10789017,"avatar_url":"https://avatars.githubusercontent.com/u/10789017?v=3","gravatar_id":"","url":"https://api.github.com/users/ericmattingly","html_url":"https://github.com/ericmattingly","followers_url":"https://api.github.com/users/ericmattingly/followers","following_url":"https://api.github.com/users/ericmattingly/following{/other_user}","gists_url":"https://api.github.com/users/ericmattingly/gists{/gist_id}","starred_url":"https://api.github.com/users/ericmattingly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericmattingly/subscriptions","organizations_url":"https://api.github.com/users/ericmattingly/orgs","repos_url":"https://api.github.com/users/ericmattingly/repos","events_url":"https://api.github.com/users/ericmattingly/events{/privacy}","received_events_url":"https://api.github.com/users/ericmattingly/received_events","type":"User","site_admin":false},"body":"opened another issue to track this change #276","created_at":"2016-08-08T16:06:59Z","updated_at":"2016-08-08T16:06:59Z","html_url":"https://github.com/Microsoft/ApplicationInsights-dotnet/pull/266#discussion_r73903472","pull_request_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/pulls/266","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/pulls/comments/73903472"},"html":{"href":"https://github.com/Microsoft/ApplicationInsights-dotnet/pull/266#discussion_r73903472"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/pulls/266"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/pulls/266","id":79390638,"html_url":"https://github.com/Microsoft/ApplicationInsights-dotnet/pull/266","diff_url":"https://github.com/Microsoft/ApplicationInsights-dotnet/pull/266.diff","patch_url":"https://github.com/Microsoft/ApplicationInsights-dotnet/pull/266.patch","issue_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/issues/266","number":266,"state":"open","locked":false,"title":"Add TrackAvailability to SDK","user":{"login":"ericmattingly","id":10789017,"avatar_url":"https://avatars.githubusercontent.com/u/10789017?v=3","gravatar_id":"","url":"https://api.github.com/users/ericmattingly","html_url":"https://github.com/ericmattingly","followers_url":"https://api.github.com/users/ericmattingly/followers","following_url":"https://api.github.com/users/ericmattingly/following{/other_user}","gists_url":"https://api.github.com/users/ericmattingly/gists{/gist_id}","starred_url":"https://api.github.com/users/ericmattingly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericmattingly/subscriptions","organizations_url":"https://api.github.com/users/ericmattingly/orgs","repos_url":"https://api.github.com/users/ericmattingly/repos","events_url":"https://api.github.com/users/ericmattingly/events{/privacy}","received_events_url":"https://api.github.com/users/ericmattingly/received_events","type":"User","site_admin":false},"body":"#255 ","created_at":"2016-07-29T16:56:50Z","updated_at":"2016-08-08T16:06:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7170a27afbe566809dbf6de27fb361dae0504616","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/pulls/266/commits","review_comments_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/pulls/266/comments","review_comment_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/issues/266/comments","statuses_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/statuses/2b90cc8e72881402cf17ef56654acfcfc2376706","head":{"label":"ericmattingly:TrackAvailability","ref":"TrackAvailability","sha":"2b90cc8e72881402cf17ef56654acfcfc2376706","user":{"login":"ericmattingly","id":10789017,"avatar_url":"https://avatars.githubusercontent.com/u/10789017?v=3","gravatar_id":"","url":"https://api.github.com/users/ericmattingly","html_url":"https://github.com/ericmattingly","followers_url":"https://api.github.com/users/ericmattingly/followers","following_url":"https://api.github.com/users/ericmattingly/following{/other_user}","gists_url":"https://api.github.com/users/ericmattingly/gists{/gist_id}","starred_url":"https://api.github.com/users/ericmattingly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericmattingly/subscriptions","organizations_url":"https://api.github.com/users/ericmattingly/orgs","repos_url":"https://api.github.com/users/ericmattingly/repos","events_url":"https://api.github.com/users/ericmattingly/events{/privacy}","received_events_url":"https://api.github.com/users/ericmattingly/received_events","type":"User","site_admin":false},"repo":{"id":64237773,"name":"ApplicationInsights-dotnet","full_name":"ericmattingly/ApplicationInsights-dotnet","owner":{"login":"ericmattingly","id":10789017,"avatar_url":"https://avatars.githubusercontent.com/u/10789017?v=3","gravatar_id":"","url":"https://api.github.com/users/ericmattingly","html_url":"https://github.com/ericmattingly","followers_url":"https://api.github.com/users/ericmattingly/followers","following_url":"https://api.github.com/users/ericmattingly/following{/other_user}","gists_url":"https://api.github.com/users/ericmattingly/gists{/gist_id}","starred_url":"https://api.github.com/users/ericmattingly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericmattingly/subscriptions","organizations_url":"https://api.github.com/users/ericmattingly/orgs","repos_url":"https://api.github.com/users/ericmattingly/repos","events_url":"https://api.github.com/users/ericmattingly/events{/privacy}","received_events_url":"https://api.github.com/users/ericmattingly/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ericmattingly/ApplicationInsights-dotnet","description":"ApplicationInsights-dotnet","fork":true,"url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet","forks_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/forks","keys_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/teams","hooks_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/hooks","issue_events_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/issues/events{/number}","events_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/events","assignees_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/assignees{/user}","branches_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/branches{/branch}","tags_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/tags","blobs_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/git/refs{/sha}","trees_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/statuses/{sha}","languages_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/languages","stargazers_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/stargazers","contributors_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/contributors","subscribers_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/subscribers","subscription_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/subscription","commits_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/commits{/sha}","git_commits_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/git/commits{/sha}","comments_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/comments{/number}","issue_comment_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/issues/comments{/number}","contents_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/contents/{+path}","compare_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/merges","archive_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/downloads","issues_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/issues{/number}","pulls_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/pulls{/number}","milestones_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/milestones{/number}","notifications_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/labels{/name}","releases_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/releases{/id}","deployments_url":"https://api.github.com/repos/ericmattingly/ApplicationInsights-dotnet/deployments","created_at":"2016-07-26T16:39:10Z","updated_at":"2016-07-26T16:39:12Z","pushed_at":"2016-07-29T22:06:58Z","git_url":"git://github.com/ericmattingly/ApplicationInsights-dotnet.git","ssh_url":"git@github.com:ericmattingly/ApplicationInsights-dotnet.git","clone_url":"https://github.com/ericmattingly/ApplicationInsights-dotnet.git","svn_url":"https://github.com/ericmattingly/ApplicationInsights-dotnet","homepage":null,"size":3996,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Microsoft:develop","ref":"develop","sha":"80cc1efbb5abe53509e11386b338004fb16fe643","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":37284654,"name":"ApplicationInsights-dotnet","full_name":"Microsoft/ApplicationInsights-dotnet","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/ApplicationInsights-dotnet","description":"ApplicationInsights-dotnet","fork":false,"url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet","forks_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/forks","keys_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/teams","hooks_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/events","assignees_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/tags","blobs_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/languages","stargazers_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/subscription","commits_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/merges","archive_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/downloads","issues_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/deployments","created_at":"2015-06-11T20:34:21Z","updated_at":"2016-07-26T08:20:42Z","pushed_at":"2016-08-08T07:42:39Z","git_url":"git://github.com/Microsoft/ApplicationInsights-dotnet.git","ssh_url":"git@github.com:Microsoft/ApplicationInsights-dotnet.git","clone_url":"https://github.com/Microsoft/ApplicationInsights-dotnet.git","svn_url":"https://github.com/Microsoft/ApplicationInsights-dotnet","homepage":null,"size":4328,"stargazers_count":62,"watchers_count":62,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":35,"mirror_url":null,"open_issues_count":19,"forks":35,"open_issues":19,"watchers":62,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/pulls/266"},"html":{"href":"https://github.com/Microsoft/ApplicationInsights-dotnet/pull/266"},"issue":{"href":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/issues/266"},"comments":{"href":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/issues/266/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/pulls/266/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/pulls/266/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet/statuses/2b90cc8e72881402cf17ef56654acfcfc2376706"}}}}
{"actor":{"display_login":"ericmattingly"}}