~/wrk2/wrk --latency -R 250 -d 3m -c 128 -t 4 -s getAnnotationsForUser_Paged.lua http://172.31.36.34:5000 Running 3m test @ http://172.31.36.34:5000 4 threads and 128 connections Thread calibration: mean lat.: 24.660ms, rate sampling interval: 10ms Thread calibration: mean lat.: 30.325ms, rate sampling interval: 10ms Thread calibration: mean lat.: 7.590ms, rate sampling interval: 10ms Thread calibration: mean lat.: 38.346ms, rate sampling interval: 13ms Thread Stats Avg Stdev Max +/- Stdev
This file contains 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
AddMap<Company>(companies => from company in companies | |
select new | |
{ | |
CompanyName = company.CompanyName, | |
UserCount = 0 | |
CompanyId = company.Id | |
}); | |
AddMap<User>(users => from user in users | |
from companyId in user.Companies |
This file contains 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
from o in docs.Orders | |
select new { | |
o.State, | |
o.CreatedAt | |
} |
This file contains 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 user = new | |
{ | |
AcceptedEula = default(bool?), // set to null, mark the field as bool? | |
RegisteredAt = DateTime.Today, // set to today, the field is DateTime | |
Name = default(string), // set to null, mark the field as string | |
ActiveTasks = 0, // set to 0, the field is an int | |
}; |
This file contains 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
from e in docs.Events | |
select new { | |
Registration = default(object) | |
} |
This file contains 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
// map | |
from o in docs.Orders | |
from l in o.Lines | |
select new { | |
l.Product, | |
Related = o.Lines.Select(x=>x.Product) | |
.Where(x=>x!=l.Product) | |
.Select(x=>new { Count = 1, Product = x}), | |
Count = 1 | |
} |
This file contains 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
try | |
{ | |
result = await httpClient.Get("/update/status"); | |
} | |
catch(HttpRequestException e) | |
{ | |
// handle error | |
} |
This file contains 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
try | |
{ | |
result = await httpClient.Get("/update/status"); | |
} | |
catch(HttpRequestException e) | |
{ | |
// handle error | |
} |
This file contains 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
HANDLE file = CreateFileW((LPCWSTR)path, | |
GENERIC_WRITE | GENERIC_READ, | |
FILE_SHARE_READ, | |
NULL, | |
CREATE_ALWAYS, | |
FILE_ATTRIBUTE_NORMAL, | |
NULL | |
); |
This file contains 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
public class IdentifierMasking | |
{ | |
private static byte[] _key; | |
public IdentifierMasking(byte[] key = null) | |
{ | |
_key = key ?? Sodium.SecretBox.GenerateKey(); | |
} | |
public string RevealIdentifier(string hidden) |
NewerOlder