-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The download counts for updated produce summaries are 10X higher than the previous ones #3810
Comments
I think the issue is with storing
To save time, I'd run queries for multiple dates in parallel in #3697 (comment), and it would have resulted in metrics getting mixed |
Fix posted in #3811 For dates which showed metrics wildly different from the norm, the data was repopulated using the script import { GoogleAuth } from "google-auth-library";
import { Agent } from "undici";
const cloudRunUrl = "https://produce-summaries-kdtacnjogq-uc.a.run.app";
const auth = new GoogleAuth();
const client = await auth.getIdTokenClient(cloudRunUrl);
globalThis[Symbol.for("undici.globalDispatcher.1")] = new Agent({
headersTimeout: 30 * 60 * 1000,
});
const start = new Date("04/01/2024");
const end = new Date("04/04/2024");
const dates = [];
for (let date = start; date <= end; date.setDate(date.getDate() + 1)) {
dates.push(date.toISOString().split("T")[0].replace(/-/g, ""));
}
await Promise.all(
dates.map(async (dateString) => {
const startTime = Date.now();
console.log(`Fetching for ${dateString}`);
const url = `${cloudRunUrl}/date/${dateString}`;
try {
const token = await client.idTokenProvider.fetchIdToken(cloudRunUrl);
const response = await fetch(url, {
method: "POST",
headers: { Authorization: `Bearer ${token}` },
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
console.log(`Successful in ${Date.now() - startTime}ms for ${dateString}`);
} catch (error) {
console.error(`Error in ${Date.now() - startTime}ms for ${dateString}`, error);
}
})
); This issue will be closed automatically when fix is merged. |
Verified that the download stats summarized by https://nodedownloads.nodeland.dev/ are in range. |
The summary was missing for the following dates from the past. I repopulated that too: 20210830
20211031
20211129
20211222
20220214
20220313
20220323
20220827
20230815 |
The content was available under |
The content was available under |
Describe the bug
The download counts for updated produce summaries are 10X higher than the previous ones.
Steps to reproduce
Run the following test code
Observed behavior
The counts are higher for some dates which were repopulated #3697 (comment), although there's no clear correlation.
Expected behavior
Counts being around the seven digits per day.
Additional context
Noticed during cross verification in #3697 (comment)
The text was updated successfully, but these errors were encountered: