Created
August 8, 2016 12:57
-
-
Save Kevin-Bronsdijk/81381b55ad6a66e0b58829ef51d34b8b to your computer and use it in GitHub Desktop.
gtmetrix-net examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GTmetrix; | |
using GTmetrix.Http; | |
var connection = Connection.Create("Api_Key", "Username"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var client = Client(connection); | |
var request = new TestRequest(new Uri("http://devslice.net"), | |
Locations.London, Browsers.Chrome); | |
var response = client.SubmitTest(request); | |
if(response.Result.StatusCode == HttpStatusCode.OK) | |
{ | |
var id = response.result.Body.TestId; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var response = client.GetTest("Test_Id"); | |
var result = responseCheck.Result; | |
if (result.StatusCode == HttpStatusCode.OK && result.Body.State == ResultStates.Completed) | |
{ | |
var pageLoadTime = result.Body.Results.PageLoadTime; | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment