Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
StackExchange.Redis integration (#130)
* use explicit type parameters * remove log line * add async, span tagging * add integration test for redis * add redis install script
- Loading branch information
1 parent
8b1929e
commit 9b594f9
Showing
23 changed files
with
521 additions
and
42 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls" | ||
|
||
$tmp = [System.IO.Path]::GetTempPath() | ||
$installerUrl = "https://github.com/MicrosoftArchive/redis/releases/download/win-3.2.100/Redis-x64-3.2.100.msi" | ||
$installerPath = Join-Path $tmp "install-redis.msi" | ||
$installerLog = Join-Path $tmp 'install-redis.log' | ||
|
||
if (Test-Path "C:\Program Files\Redis\redis-server.exe") { | ||
Write-Output "redis is already installed" | ||
Exit 0; | ||
} | ||
|
||
if (-not (Test-Path $installerPath)) { | ||
Write-Output "downloading redis to $installerPath" | ||
(New-Object Net.WebClient).DownloadFile($installerUrl, $installerPath) | ||
} | ||
|
||
Write-Output "installing redis" | ||
Start-Process "msiexec.exe" -ArgumentList "/i",$installerPath,"/qn","/norestart","/L",$installerLog -Wait -NoNewWindow | ||
Get-Content $installerLog |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using StackExchange.Redis; | ||
|
||
namespace Samples.RedisCore | ||
{ | ||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
var redis = ConnectionMultiplexer.Connect("localhost"); | ||
for (var i = 0; i < 100; i++) | ||
{ | ||
redis.GetDatabase().StringSet($"KEY-{i}", $"VALUE {i}"); | ||
var value = redis.GetDatabase().StringGetAsync($"KEY-{i}").Result; | ||
Console.WriteLine(value.ToString()); | ||
} | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"profiles": { | ||
"Samples.RedisCore": { | ||
"commandName": "Project" | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFrameworks>net461;net47;netcoreapp2.0</TargetFrameworks> | ||
<Platforms>AnyCPU;x64;x86</Platforms> | ||
<RuntimeIdentifiers>win-x64;win-x86;linux-x64</RuntimeIdentifiers> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT' "> | ||
<TargetFrameworks>netcoreapp2.0</TargetFrameworks> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(TargetFramework)' != 'netcoreapp2.0'"> | ||
<RuntimeIdentifier>win-$(Platform)</RuntimeIdentifier> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="StackExchange.Redis" Version="2.0.505" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Datadog.Trace.ClrProfiler.Managed\Datadog.Trace.ClrProfiler.Managed.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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
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
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
Oops, something went wrong.