Skip to content

Commit

Permalink
Scaffold VPS data source
Browse files Browse the repository at this point in the history
  • Loading branch information
ronnygunawan committed Jan 31, 2024
1 parent f8f95d4 commit f2a4779
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 16 deletions.
2 changes: 1 addition & 1 deletion BotNet.Commands/BotNet.Commands.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.1" />
</ItemGroup>

</Project>
15 changes: 8 additions & 7 deletions BotNet.Services/BotNet.Services.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,23 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AngleSharp" Version="1.0.7" />
<PackageReference Include="AngleSharp" Version="1.1.0" />
<PackageReference Include="DynamicExpresso.Core" Version="2.16.1" />
<PackageReference Include="Grpc.Net.Client" Version="2.59.0" />
<PackageReference Include="Google.Apis.Sheets.v4" Version="1.66.0.3148" />
<PackageReference Include="Grpc.Net.Client" Version="2.60.0" />
<PackageReference Include="Microsoft.ClearScript" Version="7.4.4" />
<PackageReference Include="Microsoft.ClearScript.V8.Native.linux-x64" Version="7.4.4" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.0" />
<PackageReference Include="Microsoft.Maui.Graphics.Skia" Version="8.0.3" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.1" />
<PackageReference Include="Microsoft.Maui.Graphics.Skia" Version="8.0.6" />
<PackageReference Include="RG.Ninja" Version="1.0.8" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.6" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.7" />
<PackageReference Include="Telegram.Bot" Version="19.0.0" />
<PackageReference Include="Google.Protobuf" Version="3.25.1" />
<PackageReference Include="Google.Protobuf" Version="3.25.2" />
<PackageReference Include="Grpc" Version="2.46.6" />
<PackageReference Include="Grpc.Tools" Version="2.59.0">
<PackageReference Include="Grpc.Tools" Version="2.60.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
12 changes: 12 additions & 0 deletions BotNet.Services/GoogleSheets/FromColumnAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;

namespace BotNet.Services.GoogleSheets {
[AttributeUsage(validOn: AttributeTargets.Property, AllowMultiple = false)]
public sealed class FromColumnAttribute : Attribute {
public string Column { get; }

public FromColumnAttribute(string column) {
Column = column;
}
}
}
25 changes: 25 additions & 0 deletions BotNet.Services/VPS/VPSBenchmark.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using BotNet.Services.GoogleSheets;

namespace BotNet.Services.VPS {
public sealed record VPSBenchmark(
[property: FromColumn("A")] string Provider,
[property: FromColumn("B")] string Location,
[property: FromColumn("C")] DateOnly BenchmarkDate,
[property: FromColumn("E")] string? VerdictCons,
[property: FromColumn("F")] decimal IdrMo,
[property: FromColumn("G")] int Core,
[property: FromColumn("H")] int SsdGb,
[property: FromColumn("I")] int RamMb,
[property: FromColumn("J")] int IoMbs,
[property: FromColumn("K")] double? ToCacheFlyMbs,
[property: FromColumn("L")] double? ToHkCnMbs,
[property: FromColumn("M")] double? ToLinodeJpMbs,
[property: FromColumn("N")] double? ToLinodeSgMbs,
[property: FromColumn("O")] double? ToLinodeUkMbs,
[property: FromColumn("P")] double? ToLinodeCaMbs,
[property: FromColumn("R")] double? BzipSec,
[property: FromColumn("S")] double? DlMbs,
[property: FromColumn("T")] double? AvgMbs
);
}
14 changes: 14 additions & 0 deletions BotNet.Services/VPS/VPSBenchmarkDataSource.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BotNet.Services.VPS {
public sealed class VPSBenchmarkDataSource {
// Source: https://docs.google.com/spreadsheets/d/14nAIFzIzkQuSxiayhc5tSFWFCWFncrV-GCA3Q5BbS4g/edit#gid=0
private const string SPREADSHEET_ID = "14nAIFzIzkQuSxiayhc5tSFWFCWFncrV-GCA3Q5BbS4g";


}
}
6 changes: 3 additions & 3 deletions BotNet.Tests/BotNet.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4">
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
10 changes: 5 additions & 5 deletions BotNet/BotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.KeyPerFile" Version="8.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
<PackageReference Include="Sentry.AspNetCore" Version="3.41.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.KeyPerFile" Version="8.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" />
<PackageReference Include="Sentry.AspNetCore" Version="3.41.4" />
<PackageReference Include="Telegram.Bot" Version="19.0.0" />
<PackageReference Include="Telegram.Bot.Extensions.Polling" Version="1.0.2" />
</ItemGroup>
Expand Down

0 comments on commit f2a4779

Please sign in to comment.