Skip to content
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

No updates on the dashboards since Jan 19 #297

Closed
FatOrangutan opened this issue Feb 10, 2019 · 9 comments
Closed

No updates on the dashboards since Jan 19 #297

FatOrangutan opened this issue Feb 10, 2019 · 9 comments

Comments

@FatOrangutan
Copy link

https://data.firefox.com/dashboard/user-activity or https://data.firefox.com/dashboard/usage-behavior - latest available data is from about 3 weeks back.

@openjck
Copy link
Contributor

openjck commented Feb 11, 2019

Thank you for reporting this.

@fbertsch, do you know what might be happening here? It looks like the raw data is stale.

@fbertsch
Copy link

The data stopped updating because of the test-pilot deprecation, which we dealt with in mozilla/Fx_Usage_Report@5dff993.

Currently backfilling the data.

Thanks for the bug report @FatOrangutan!

@pdehaan
Copy link
Collaborator

pdehaan commented Feb 11, 2019

Is there a way to tell if the data is stale (apart from hovering over a chart and seeing the last updated date was Jan 18)?

Or, if it's easier to scrape one of the data endpoints and see what the latest x-axis value is: https://data.firefox.com/datasets/desktop/user-activity/Worldwide/YAU

I'm wondering if we should try adding some test on a cron job that scrapes the data.firefox.com site and makes sure the data is no older than 8 days.

@pdehaan
Copy link
Collaborator

pdehaan commented Feb 11, 2019

Here's a cheap way of checking the last modified date (at least for YAU).

const axios = require("axios");
const ms = require("ms");

async function main(uri) {
  const res = await axios.get(uri);
  const latestDate = new Date(res.data.data.populations.default.pop().x);
  console.log(ms(latestDate - Date.now()));
}

main("https://data.firefox.com/datasets/desktop/user-activity/Worldwide/YAU"); // -24d

Not sure if there is a better way (such as including the last modified date in the payload). Interestingly the date and last-modified dates in the response headers showed today's date and not the time the upstream data was last updated.

date: Mon, 11 Feb 2019 20:05:12 GMT
last-modified: Mon, 11 Feb 2019 19:38:35 GMT

UPDATE: Converted the snippet above into a repo at https://github.com/pdehaan/ensemble-data-test

@openjck
Copy link
Contributor

openjck commented Feb 12, 2019

That's a good question. I would love to have some kind of alerting when the data is stale. Frank, do you think it would make more sense for us to do that testing here or in the FX_Usage_Report repo?

@openjck
Copy link
Contributor

openjck commented Feb 12, 2019

I can see the data has been updated. This issue is closed, but I'd still like to get alerts when the data is stale since this has happened a couple of times already. I opened issue #303 for that.

@pdehaan
Copy link
Collaborator

pdehaan commented Feb 15, 2019

Interestingly, it looks like the User Activity and Usage Behavior dashboards are 6 days old, but the Hardware dashboard is 12 days old.

[-6d] https://data.firefox.com/datasets/desktop/user-activity
[-6d] https://data.firefox.com/datasets/desktop/usage-behavior
[-12d] https://data.firefox.com/datasets/desktop/hardware

Not sure if that is expected or not, but I found it interesting.

const axios = require("axios");
const ms = require("ms");

const dashboards = [
  "https://data.firefox.com/datasets/desktop/user-activity",
  "https://data.firefox.com/datasets/desktop/usage-behavior",
  "https://data.firefox.com/datasets/desktop/hardware"
];

main(dashboards);

async function main(dashboards) {
  for (const dashboardUrl of dashboards) {
    const dashboardAge = await lastModified(dashboardUrl);
    const ageNum = parseInt(dashboardAge, 10);
    console.log(`[${dashboardAge}] ${dashboardUrl}`);
    if (ageNum < -7) {
      process.exitCode = 1;
    }
  }
}

async function lastModified(uri) {
  const { data } = await axios.get(uri);
  const latestDate = new Date(data.dates[0]);
  return ms(latestDate - Date.now());
}

@openjck
Copy link
Contributor

openjck commented Feb 19, 2019

Not sure why hardware would be older than the other two, although I see that that's still the case. I'll ask @fbertsch in Slack.

@pdehaan
Copy link
Collaborator

pdehaan commented Feb 20, 2019

I wrapped this in a basic Express app and uploaded it to https://ensemble-last-modified.now.sh/
(source at https://github.com/pdehaan/ensemble-last-modified)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants