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

Where the enqueued daily statistics job are started? #67

Closed
ronanrodrigo opened this issue Nov 25, 2021 · 4 comments
Closed

Where the enqueued daily statistics job are started? #67

ronanrodrigo opened this issue Nov 25, 2021 · 4 comments

Comments

@ronanrodrigo
Copy link
Contributor

ronanrodrigo commented Nov 25, 2021

I am trying get values from DailyStatisticsJob at /v1/statistics/build/count?days=14 but the statistics_day_build_time table is empty. And while debugging the XCMetricsBackendLib/Config/configure.swift there isn't a call to startScheduledJobs() or similar across the project.

I am missing where it is being called? Or there is other way to start the scheduled jobs?

@ronanrodrigo ronanrodrigo changed the title Where and when the enqueued daily statistics job are started? Where the enqueued daily statistics job are started? Nov 25, 2021
@ronanrodrigo
Copy link
Contributor Author

Adding this to my project the table started to being populated

public func configure(_ app: Application) throws {

    // ...

    if config.scheduleStatisticsJobs {
        // ...
        try app.queues.startScheduledJobs()
    }

    // ...
}

@ronanrodrigo
Copy link
Contributor Author

I found some other stuffs... On routes.swift the try app.queues.startInProcessJobs(on: .default) and on xcmetrics-jobs-deployment.yaml this:

command: ["./XCMetricsBackend",
    "queues",
    "--env",
    "production"]

But even running the command above, nothing happens. There is any documentation about the workers/schedulers?

@ecamacho
Copy link
Contributor

Hi. You need to start the process with

        command: ["./XCMetricsBackend",
                  "queues",
                  "--scheduled",
                  "--env",
                  "production"]

It will run every day and create the statistics_day_counts table.

I will add documentation about this.

@ronanrodrigo
Copy link
Contributor Author

@ecamacho thanks!

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

2 participants