decord/source/modules/local_message_caching/LocalMessageCacheStatsManager.tsx
github-actions 67d978d9fb chore: update source for alpha 346.0
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9672_m.js (378.6 MB)
2026-09-07 16:44:02 +00:00

73 lines
2.7 KiB
TypeScript

// Module ID: 17893
// Function ID: 17894
// Name: makeLogLine
// Dependencies: [1074, 7488, 1242, 7118, 2]
// Module 17893 (makeLogLine)
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 */;
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;
const fetchLogs = recordChannelFetchStartDefault.fetchLogs;
const mapped = Array.from(fetchLogs.values()).map(makeLogLine);
let obj = expandEventPropertiesDefault;
obj = { num_channels_fetch_started: null, num_channels_local_cached: null, num_channels_fetched_network: null, num_times_backgrounded: null, fetch_entries: null };
obj[0] = recordChannelFetchStartDefault.channelsFetchStarted.size;
obj[1] = recordChannelFetchStartDefault.channelsFetchedWithLocalMessages.size;
obj[2] = recordChannelFetchStartDefault.channelsFetchedNetwork.size;
const sum = c4 + 1;
c4 = sum;
obj[3] = sum;
obj[4] = mapped;
obj.track(constants.CACHE_STATS_RECORDED, obj);
const arr = Array.from(fetchLogs.values());
}
}
({ AnalyticEvents: obj1, AppStates: c3 } = ME);
let c4 = 0;
initializeDefault;
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();
const result = set.fileFinishedImporting("modules/local_message_caching/LocalMessageCacheStatsManager.tsx");
export default prototype;