mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 01:28:59 +08:00
parent
a363b98657
commit
d93cc767a6
@ -3381,9 +3381,9 @@ func (r *ClickHouseReader) GetLogsInfoInLastHeartBeatInterval(ctx context.Contex
|
|||||||
|
|
||||||
queryStr := fmt.Sprintf("select count() from %s.%s where timestamp > toUnixTimestamp(now()-toIntervalMinute(%d))*1000000000;", r.logsDB, r.logsTable, 30)
|
queryStr := fmt.Sprintf("select count() from %s.%s where timestamp > toUnixTimestamp(now()-toIntervalMinute(%d))*1000000000;", r.logsDB, r.logsTable, 30)
|
||||||
|
|
||||||
r.db.QueryRow(ctx, queryStr).Scan(&totalLogLines)
|
err := r.db.QueryRow(ctx, queryStr).Scan(&totalLogLines)
|
||||||
|
|
||||||
return totalLogLines, nil
|
return totalLogLines, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *ClickHouseReader) GetTagsInfoInLastHeartBeatInterval(ctx context.Context) (*model.TagsInfo, error) {
|
func (r *ClickHouseReader) GetTagsInfoInLastHeartBeatInterval(ctx context.Context) (*model.TagsInfo, error) {
|
||||||
|
@ -199,6 +199,12 @@ func createTelemetry() {
|
|||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-activeUserTicker.C:
|
case <-activeUserTicker.C:
|
||||||
|
if telemetry.activeUser["logs"] != 0 {
|
||||||
|
getLogsInfoInLastHeartBeatInterval, err := telemetry.reader.GetLogsInfoInLastHeartBeatInterval(context.Background())
|
||||||
|
if err != nil && getLogsInfoInLastHeartBeatInterval == 0 {
|
||||||
|
telemetry.activeUser["logs"] = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
if (telemetry.activeUser["traces"] != 0) || (telemetry.activeUser["metrics"] != 0) || (telemetry.activeUser["logs"] != 0) {
|
if (telemetry.activeUser["traces"] != 0) || (telemetry.activeUser["metrics"] != 0) || (telemetry.activeUser["logs"] != 0) {
|
||||||
telemetry.activeUser["any"] = 1
|
telemetry.activeUser["any"] = 1
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user