decord/source/modules/local_message_caching/LocalMessageCacheStatsManager.tsx

74 lines
2.7 KiB
TypeScript
Raw Normal View History

// Module ID: 17893
// Function ID: 17894
2026-07-29 08:29:29 +00:00
// Name: makeLogLine
// Dependencies: [1074, 7488, 1242, 7118, 2]
2026-07-20 16:05:17 +00:00
// Module 17893 (makeLogLine)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
import expandEventPropertiesDefault from "expandEventProperties" /* 1242 */;
import initializeDefault from "initialize" /* 7118 */;
import recordChannelFetchStartDefault from "recordChannelFetchStart" /* 7488 */;
import ME from "ME" /* 1074 */;
2026-07-23 10:11:24 +00:00
2026-07-20 16:05:17 +00:00
function makeLogLine(channelId) {
const items = [channelId.channelId, , , ];
let str = "-1";
let str2 = "-1";
if (null != channelId.localMessageDetails) {
str2 = channelId.localMessageDetails.loadTime - channelId.startTime;
}
items[1] = str2;
if (null != channelId.networkMessageDetails) {
str = channelId.networkMessageDetails.loadTime - channelId.startTime;
}
items[2] = str;
let str3 = "incomplete";
if (null != channelId.localMessageDetails) {
str3 = "incomplete";
if (null != channelId.networkMessageDetails) {
let str5 = "mismatch";
if (channelId.localMessageDetails.count === channelId.networkMessageDetails.count) {
str5 = "mismatch";
if (channelId.localMessageDetails.lastMessageId === channelId.networkMessageDetails.lastMessageId) {
str5 = "match";
}
}
str3 = str5;
}
}
items[3] = str3;
return items.join(":");
}
function handleAppStateUpdate(state) {
if (state.state === constants2.BACKGROUND) {
const _Array = Array;
2026-08-24 06:08:38 +00:00
const fetchLogs = recordChannelFetchStartDefault.fetchLogs;
2026-07-20 16:05:17 +00:00
const mapped = Array.from(fetchLogs.values()).map(makeLogLine);
2026-08-24 06:08:38 +00:00
let obj = expandEventPropertiesDefault;
2026-07-29 08:29:29 +00:00
obj = { num_channels_fetch_started: null, num_channels_local_cached: null, num_channels_fetched_network: null, num_times_backgrounded: null, fetch_entries: null };
2026-08-24 06:08:38 +00:00
obj[0] = recordChannelFetchStartDefault.channelsFetchStarted.size;
obj[1] = recordChannelFetchStartDefault.channelsFetchedWithLocalMessages.size;
obj[2] = recordChannelFetchStartDefault.channelsFetchedNetwork.size;
2026-07-29 08:29:29 +00:00
const sum = c4 + 1;
c4 = sum;
obj[3] = sum;
obj[4] = mapped;
2026-07-20 16:05:17 +00:00
obj.track(constants.CACHE_STATS_RECORDED, obj);
const arr = Array.from(fetchLogs.values());
}
}
2026-07-29 08:29:29 +00:00
({ AnalyticEvents: obj1, AppStates: c3 } = ME);
let c4 = 0;
2026-08-24 06:08:38 +00:00
initializeDefault;
2026-07-29 08:29:29 +00:00
let prototype = function LocalMessageCacheStatsManager() {
const applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
applyArgumentsResult.actions = { APP_STATE_UPDATE: handleAppStateUpdate };
return applyArgumentsResult;
}.prototype;
class prototype extends tmp3 {
}
prototype = new prototype();
2026-08-24 06:08:38 +00:00
const result = set.fileFinishedImporting("modules/local_message_caching/LocalMessageCacheStatsManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default prototype;