diff --git a/src/Infrastructure/Masa.Tsc.Storage.Clickhouse.Apm/Cliclhouse/ClickhouseApmService.cs b/src/Infrastructure/Masa.Tsc.Storage.Clickhouse.Apm/Cliclhouse/ClickhouseApmService.cs index 067ad346..55e8751b 100644 --- a/src/Infrastructure/Masa.Tsc.Storage.Clickhouse.Apm/Cliclhouse/ClickhouseApmService.cs +++ b/src/Infrastructure/Masa.Tsc.Storage.Clickhouse.Apm/Cliclhouse/ClickhouseApmService.cs @@ -68,7 +68,7 @@ public Task EndpointLatencyDistributionAsync(Apm if (p95 is not double.NaN) result.P95 = (long)Math.Floor(p95); - var sql = $@"select Duration/{MILLSECOND},count(1) total from {MasaStackClickhouseConnection.TraceHttpServerTable} where {where} group by Duration order by Duration"; + var sql = $@"select Duration/{MILLSECOND},count(1) total from {Constants.DurationCountTable1} where {where} group by Duration order by Duration"; var list = new List(); lock (lockObj) { @@ -731,7 +731,7 @@ private IDataReader Query(string sql, IEnumerable parameter { var end = DateTime.Now; var duration = (end - start).TotalSeconds; - if (duration - 3 > 0) + //if (duration - 1 > 0) _logger.LogWarning("Clickhouse query slow {Duration}s, rawSql:{Rawsql}, parameters:{Paramters}", duration, sql, parameters); } } @@ -751,7 +751,7 @@ private object Scalar(string sql, IEnumerable parameters) { var end = DateTime.Now; var duration = (end - start).TotalSeconds; - if (duration - 3 > 0) + //if (duration - 1 > 0) _logger.LogWarning("Clickhouse query slow {Duration}s, rawSql:{Rawsql}, parameters:{Paramters}", duration, sql, parameters); } } diff --git a/src/Infrastructure/Masa.Tsc.Storage.Clickhouse.Apm/Config/Constants.cs b/src/Infrastructure/Masa.Tsc.Storage.Clickhouse.Apm/Config/Constants.cs index 45764ba1..bebf78ce 100644 --- a/src/Infrastructure/Masa.Tsc.Storage.Clickhouse.Apm/Config/Constants.cs +++ b/src/Infrastructure/Masa.Tsc.Storage.Clickhouse.Apm/Config/Constants.cs @@ -8,7 +8,7 @@ internal static class Constants public static string ErrorTable { get; private set; } private const string AggregateTable = "otel_trace_metrics@interval"; - private const string DurationCountTable = "otel_traces_spans_duration@intervalcount_aaaaaaaaaaaaaa"; + private const string DurationCountTable = "otel_traces_spans_duration@intervalcount"; public static string DurationTable { get; private set; } @@ -53,8 +53,8 @@ public static void Init(string database, string suffix) database = $"{database}."; ErrorTable = $"{database}otel_errors_{suffix}"; DurationTable = $"{database}otel_traces_spans_duration_{suffix}"; - DurationCountTable1 = $"{database}otel_traces_spans_duration_count_{suffix}_aaaaaaaaaaaaaa"; - ModelsTable = $"{database}tsc_phone_models_{suffix}_aaaaaaaaaaaaaa"; + DurationCountTable1 = $"{database}otel_traces_spans_duration_count_{suffix}"; + ModelsTable = $"{database}tsc_phone_models_{suffix}"; foreach (var key in INTERVALS) { DicAggregateTable.Add(key, database + GetAggregateTable(key, suffix)); diff --git a/src/Infrastructure/Masa.Tsc.Storage.Clickhouse/Extensions/IDbConnectionExtensitions.cs b/src/Infrastructure/Masa.Tsc.Storage.Clickhouse/Extensions/IDbConnectionExtensitions.cs index 0f366f12..d18827b0 100644 --- a/src/Infrastructure/Masa.Tsc.Storage.Clickhouse/Extensions/IDbConnectionExtensitions.cs +++ b/src/Infrastructure/Masa.Tsc.Storage.Clickhouse/Extensions/IDbConnectionExtensitions.cs @@ -344,7 +344,7 @@ private static void ParseWhere(StringBuilder sql, object value, List 0) + //if (duration - 1 > 0) ClickhouseInit.Logger.LogWarning("Clickhouse query slow {Duration}s, rawSql:{Rawsql}, parameters:{Paramters}", duration, sql, parameters); } } @@ -386,7 +386,7 @@ public static List Query(this IDbConnection dbConnection, string sql, IDat { var end = DateTime.Now; var duration = (end - start).TotalSeconds; - if (duration - 3 > 0) + //if (duration - 1 > 0) ClickhouseInit.Logger.LogWarning("Clickhouse query slow {Duration}s, rawSql:{Rawsql}, parameters:{Paramters}", duration, sql, parameters); } }