Skip to content

Commit ab5f85a

Browse files
authored
Update schedule (#2242)
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
1 parent 42265d1 commit ab5f85a

6 files changed

Lines changed: 45 additions & 2 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@red-hat-developer-hub/backstage-plugin-scorecard-backend': patch
3+
---
4+
5+
Updated default schedule for pulling metrics to have `initialDelay` of 1 minute

workspaces/scorecard/app-config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,19 @@ permission:
159159
admin:
160160
users:
161161
- name: user:development/guest
162+
163+
# Scorecard development configuration
164+
scorecard:
165+
plugins:
166+
jira:
167+
open_issues:
168+
schedule:
169+
frequency: { minutes: 5 }
170+
timeout: { minutes: 10 }
171+
initialDelay: { seconds: 5 }
172+
github:
173+
open_prs:
174+
schedule:
175+
frequency: { minutes: 5 }
176+
timeout: { minutes: 10 }
177+
initialDelay: { seconds: 5 }

workspaces/scorecard/plugins/scorecard-backend/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,19 @@ This policy would allow users to read only the GitHub Open PRs metric, while res
7171
7272
The Scorecard plugin collects metrics from third-party data sources using metric providers. The Scorecard node plugin provides `scorecardMetricsExtensionPoint` extension point that is used to connect your backend plugin module that exports custom metrics via metric providers to the Scorecard backend plugin. For detailed information on creating metric providers, see [providers.md](./docs/providers.md).
7373

74+
### Metric Collection Scheduling
75+
76+
The Scorecard plugin automatically collects metrics on a scheduled basis. You can customize the schedule for any metric provider in your `app-config.yaml`. If no schedule is configured, metric providers use the following default schedule:
77+
78+
```yaml
79+
schedule:
80+
frequency: { hours: 1 }
81+
timeout: { minutes: 15 }
82+
initialDelay: { minutes: 1 }
83+
```
84+
85+
For more information about schedule configuration options, see the [Metric Collection Scheduling](./docs/providers.md#metric-collection-scheduling) section in providers.md.
86+
7487
### Available Metric Providers
7588

7689
The following metric providers are available:

workspaces/scorecard/plugins/scorecard-backend/docs/providers.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,15 @@ The schedule configuration follows Backstage's `SchedulerServiceTaskScheduleDefi
173173

174174
Make sure the configured schedule stays within provider API rate limits.
175175

176+
If no schedule is configured, metric providers use the following default schedule:
177+
178+
```yaml
179+
schedule:
180+
frequency: { hours: 1 }
181+
timeout: { minutes: 15 }
182+
initialDelay: { minutes: 1 }
183+
```
184+
176185
## Example Metric Providers
177186

178187
The following are examples of existing metric providers that you can reference:

workspaces/scorecard/plugins/scorecard-backend/src/scheduler/tasks/PullMetricsByProviderTask.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ describe('PullMetricsByProviderTask', () => {
164164
expect(config).toEqual({
165165
frequency: { hours: 1 },
166166
timeout: { minutes: 15 },
167-
initialDelay: { seconds: 3 },
167+
initialDelay: { minutes: 1 },
168168
});
169169
});
170170

workspaces/scorecard/plugins/scorecard-backend/src/scheduler/tasks/PullMetricsByProviderTask.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class PullMetricsByProviderTask implements SchedulerTask {
6161
{
6262
frequency: { hours: 1 },
6363
timeout: { minutes: 15 },
64-
initialDelay: { seconds: 3 },
64+
initialDelay: { minutes: 1 },
6565
};
6666

6767
constructor(options: Options, provider: MetricProvider) {

0 commit comments

Comments
 (0)