Skip to content

Commit

Permalink
fix: 查询优化
Browse files Browse the repository at this point in the history
  • Loading branch information
Qinyouzeng committed Jul 16, 2024
1 parent 49961f9 commit a04a5fa
Show file tree
Hide file tree
Showing 9 changed files with 197 additions and 170 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public interface IApmService : IDisposable

Task<IEnumerable<ChartLineCountDto>> GetLogChartAsync(ApmEndpointRequestDto query);

Dictionary<string, List<string>> GetEnviromentServices(BaseApmRequestDto query);
Task<Dictionary<string, List<string>>> GetEnviromentServices(BaseApmRequestDto query);

Task<PhoneModelDto> GetDeviceModelAsync(string brand, string model);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static string GetAttributeName(string name, bool isLog)
{
var pre = isLog ? "Log" : "Span";
var field = name[(ATTRIBUTE_KEY.Length)..];
if (isLog && (field.Equals("exception.message", StringComparison.CurrentCultureIgnoreCase)))
if (isLog && (field.Equals("exception.message", StringComparison.CurrentCultureIgnoreCase) || field.Equals("http.target", StringComparison.CurrentCultureIgnoreCase)))
return $"{ATTRIBUTE_KEY}{field}";

if (!isLog && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ internal ClickhouseStorageLog() { }

public override string LogWarningText => "Warning";

public override string Url => "Attributes.RequestPath";
public override string Url => "Attributes.http.target";
}

public class ClickhouseStorageTrace : StorageTrace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ClickHouse.Ado" Version="1.5.5" />
<PackageReference Include="ClickHouse.Ado" Version="2.0.5" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="TimeZoneConverter" Version="6.1.0" />
Expand Down
4 changes: 2 additions & 2 deletions src/Services/Masa.Tsc.Service.Admin/Services/ApmService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ public async Task<PaginatedListBase<LogResponseDto>> GetLogList([FromServices] I
public async Task<PhoneModelDto> GetModel([FromServices] IApmService apmService, string brand, string model)
=> await apmService.GetDeviceModelAsync(brand, model);

public Dictionary<string, List<string>> GetEnviromentService([FromServices] IApmService apmService, string start, string end)
=> apmService.GetEnviromentServices(new BaseApmRequestDto
public async Task<Dictionary<string, List<string>>> GetEnviromentService([FromServices] IApmService apmService, string start, string end)
=> await apmService.GetEnviromentServices(new BaseApmRequestDto
{
Start = start.ParseUTCTime(),
End = end.ParseUTCTime()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,14 @@ private async Task OnLoadAsync(SearchData data = null)
{
loading = true;
if (data != null)
{
currentPage = 1;
total = 0;
Search = data;
await LoadChartDataAsync();
}
await ChangeRecordAsync();
loading = false;
await LoadChartDataAsync();
}

protected override async Task OnParametersSetAsync()
Expand Down
1 change: 1 addition & 0 deletions src/Web/Masa.Tsc.Web.Admin.Rcl/Pages/Apm/Errors.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ private async Task LoadASync(SearchData data = null!)
if (data != null)
{
page = 1;
total = 0;
Search = data;
}
StateHasChanged();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ protected override async Task OnParametersSetAsync()
private async Task LoadASync(SearchData data = null)
{
if (data != null)
{
page = 1;
total = 0;
SearchData = data;
}
if (isTableLoading)
{
return;
Expand Down

0 comments on commit a04a5fa

Please sign in to comment.