Skip to content

Commit 36af640

Browse files
committed
reduce profiler freq
1 parent d142f11 commit 36af640

4 files changed

Lines changed: 36 additions & 36 deletions

File tree

global.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,8 @@ type MetricName =
489489
| 'pmh_fullhistory'
490490
| 'pmh_gcdata'
491491
| 'pmh_parsed'
492-
| 'reconcile';
492+
| 'reconcile'
493+
| 'profiler';
493494

494495
// Object to map player_slot to basic info
495496
type PGroup = {

svc/autoprofiler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ async function doProfiler() {
2121
}),
2222
);
2323
}
24-
invokeIntervalAsync(doProfiler, 5000);
24+
invokeIntervalAsync(doProfiler, 10000);

svc/profiler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ import {
66
SteamAPIUrls,
77
convert64to32,
88
invokeIntervalAsync,
9+
redisCount,
910
} from './util/utility';
1011
import redis from './store/redis';
1112

1213
async function doProfile() {
13-
// Fetch up to 100 items off the queue, if we don't have 100 yet wait
1414
const resp = await redis.lpop('profileQueue', 100);
1515
if (!resp || !resp.length) {
1616
return;
1717
}
18+
redisCount('profiler', resp.length);
1819
const jobs = resp.map((item) => JSON.parse(item) as ProfileJob);
1920
const url = SteamAPIUrls.api_summaries({
2021
players: jobs,

svc/util/buildStatus.ts

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -81,32 +81,35 @@ export async function buildStatus() {
8181
matches_last_day: async () => countDay('added_match'),
8282
matches_prev_hour: async () => countLastHour('added_match'),
8383
retriever_matches_last_day: async () => countDay('retriever'),
84+
retriever_players_last_day: async () => countDay('retriever_player'),
85+
// retriever_matches_current_hour: async () => countHour('retriever'),
8486
parsed_matches_last_day: async () => countDay('parser'),
8587
gcdata_matches_last_day: async () => countDay('gcdata'),
86-
tracked_players: async () => redis.zcard('tracked'),
87-
auto_parse_last_day: async () => countDay('auto_parse'),
88-
89-
retriever_matches_current_hour: async () => countHour('retriever'),
90-
retriever_players_last_day: async () => countDay('retriever_player'),
91-
parse_jobs_last_day: async () => countDay('parser_job'),
92-
parse_fails_last_day: async () => countDay('parser_fail'),
93-
parse_crashes_last_day: async () => countDay('parser_crash'),
94-
parse_skips_last_day: async () => countDay('parser_skip'),
95-
96-
requests_last_day: async () => countDay('request'),
97-
distinct_requests_last_day: async () =>
98-
countDayDistinct('distinct_request'),
99-
requests_ui_last_day: async () => countDay('request_ui'),
100-
requests_api_key_last_day: async () => countDay('request_api_key'),
101-
request_api_fail_last_day: async () => countDay('request_api_fail'),
88+
profiler_last_day: async () => countDay('profiler'),
10289
fullhistory_last_day: async () => countDay('fullhistory'),
10390
fullhistory_skips_last_day: async () => countDay('fullhistory_skip'),
10491
pmh_fullhistory_last_day: async () => countDay('pmh_fullhistory'),
10592
pmh_gcdata_last_day: async () => countDay('pmh_gcdata'),
10693
pmh_parsed_last_day: async () => countDay('pmh_parsed'),
10794
reconcile_last_day: async () => countDay('reconcile'),
95+
requests_last_day: async () => countDay('request'),
96+
distinct_requests_last_day: async () => countDayDistinct('distinct_request'),
97+
requests_ui_last_day: async () => countDay('request_ui'),
98+
requests_api_key_last_day: async () => countDay('request_api_key'),
99+
request_api_fail_last_day: async () => countDay('request_api_fail'),
100+
tracked_players: async () => redis.zcard('tracked'),
101+
auto_parse_last_day: async () => countDay('auto_parse'),
108102
meta_parsed_last_day: async () => countDay('meta_parse'),
109103

104+
parse_jobs_last_day: async () => countDay('parser_job'),
105+
parse_fails_last_day: async () => countDay('parser_fail'),
106+
parse_crashes_last_day: async () => countDay('parser_crash'),
107+
parse_skips_last_day: async () => countDay('parser_skip'),
108+
// reapi_last_day: async () => countDay('reapi'),
109+
regcdata_last_day: async () => countDay('regcdata'),
110+
reparse_last_day: async () => countDay('reparse'),
111+
// oldparse_last_day: async () => countDay('oldparse'),
112+
110113
steam_api_calls_last_day: async () => countDay('steam_api_call'),
111114
steam_proxy_calls_last_day: async () => countDay('steam_proxy_call'),
112115
steam_429_last_day: async () => countDay('steam_429'),
@@ -157,23 +160,18 @@ export async function buildStatus() {
157160
// countDayDistinct('distinct_match_player_recent_user'),
158161

159162
match_cache_hit_last_day: async () => countDay('match_cache_hit'),
160-
player_temp_hit_last_day: async () => countDay('player_temp_hit'),
161-
player_temp_miss_last_day: async () => countDay('player_temp_miss'),
162-
player_temp_skip_last_day: async () => countDay('player_temp_skip'),
163-
player_temp_wait_last_day: async () => countDay('player_temp_wait'),
164-
player_temp_write_last_day: async () => countDay('player_temp_write'),
165-
player_temp_write_bytes_last_day: async () =>
166-
countDay('player_temp_write_bytes'),
167-
distinct_player_temp_read_last_day: async () =>
168-
countDayDistinct('distinct_player_temp'),
169-
auto_player_temp_last_day: async () => countDay('auto_player_temp'),
170-
distinct_auto_player_temp_last_day: async () =>
171-
countDayDistinct('distinct_auto_player_temp'),
172-
173-
// reapi_last_day: async () => countDay('reapi'),
174-
regcdata_last_day: async () => countDay('regcdata'),
175-
reparse_last_day: async () => countDay('reparse'),
176-
// oldparse_last_day: async () => countDay('oldparse'),
163+
// player_temp_hit_last_day: async () => countDay('player_temp_hit'),
164+
// player_temp_miss_last_day: async () => countDay('player_temp_miss'),
165+
// player_temp_skip_last_day: async () => countDay('player_temp_skip'),
166+
// player_temp_wait_last_day: async () => countDay('player_temp_wait'),
167+
// player_temp_write_last_day: async () => countDay('player_temp_write'),
168+
// player_temp_write_bytes_last_day: async () =>
169+
// countDay('player_temp_write_bytes'),
170+
// distinct_player_temp_read_last_day: async () =>
171+
// countDayDistinct('distinct_player_temp'),
172+
// auto_player_temp_last_day: async () => countDay('auto_player_temp'),
173+
// distinct_auto_player_temp_last_day: async () =>
174+
// countDayDistinct('distinct_auto_player_temp'),
177175

178176
error_last_day: async () => countDay('500_error'),
179177
web_crash_last_day: async () => countDay('web_crash'),

0 commit comments

Comments
 (0)