Skip to content

Commit

Permalink
[Task Manager] Fixing typo in field name (#103948)
Browse files Browse the repository at this point in the history
* Fixing typo

* Fixing typo

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
ymao1 and kibanamachine authored Jul 1, 2021
1 parent dd3a806 commit 7cc112d
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ The API returns the following:
"overdue": 10,
"overdue_non_recurring": 10,
"estimated_schedule_density": [0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 3, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0],
"capacity_requirments": {
"capacity_requirements": {
"per_minute": 6,
"per_hour": 28,
"per_day": 2
Expand Down Expand Up @@ -737,7 +737,7 @@ Evaluating the preceding health stats in the previous example, you see the follo
0, 3, 0, 0, 0, 1, 0, 1, 0, 1,
0, 0, 0, 1, 0, 0, 1, 1, 1, 0
],
"capacity_requirments": { # <10>
"capacity_requirements": { # <10>
"per_minute": 14,
"per_hour": 240,
"per_day": 0
Expand Down Expand Up @@ -819,7 +819,7 @@ Suppose the output of `stats.workload.value` looked something like this:
0, 31, 0, 12, 16, 31, 0, 10, 0, 10,
3, 22, 0, 10, 0, 2, 10, 10, 1, 0
],
"capacity_requirments": {
"capacity_requirements": {
"per_minute": 329, # <4>
"per_hour": 4272, # <5>
"per_day": 61 # <6>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ function getMockMonitoredHealth(overrides = {}): MonitoredHealth {
non_recurring: 20,
owner_ids: 2,
estimated_schedule_density: [],
capacity_requirments: {
capacity_requirements: {
per_minute: 150,
per_hour: 360,
per_day: 820,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('estimateCapacity', () => {
{
owner_ids: 1,
overdue_non_recurring: 0,
capacity_requirments: {
capacity_requirements: {
per_minute: 60,
per_hour: 0,
per_day: 0,
Expand Down Expand Up @@ -72,7 +72,7 @@ describe('estimateCapacity', () => {
{
owner_ids: 1,
overdue_non_recurring: 0,
capacity_requirments: {
capacity_requirements: {
per_minute: 60,
per_hour: 0,
per_day: 0,
Expand Down Expand Up @@ -129,7 +129,7 @@ describe('estimateCapacity', () => {
{
owner_ids: 1,
overdue_non_recurring: 0,
capacity_requirments: {
capacity_requirements: {
per_minute: 60,
per_hour: 0,
per_day: 0,
Expand Down Expand Up @@ -165,7 +165,7 @@ describe('estimateCapacity', () => {
{
owner_ids: 1,
overdue_non_recurring: 0,
capacity_requirments: {
capacity_requirements: {
per_minute: 0,
per_hour: 12000,
per_day: 200,
Expand Down Expand Up @@ -221,7 +221,7 @@ describe('estimateCapacity', () => {
// 0 active tasks at this moment in time, so no owners identifiable
owner_ids: 0,
overdue_non_recurring: 0,
capacity_requirments: {
capacity_requirements: {
per_minute: 60,
per_hour: 0,
per_day: 0,
Expand Down Expand Up @@ -276,7 +276,7 @@ describe('estimateCapacity', () => {
{
owner_ids: 3,
overdue_non_recurring: 0,
capacity_requirments: {
capacity_requirements: {
per_minute: 150,
per_hour: 60,
per_day: 0,
Expand Down Expand Up @@ -337,7 +337,7 @@ describe('estimateCapacity', () => {
{
owner_ids: provisionedKibanaInstances,
overdue_non_recurring: 0,
capacity_requirments: {
capacity_requirements: {
per_minute: 150,
per_hour: 60,
per_day: 0,
Expand Down Expand Up @@ -417,7 +417,7 @@ describe('estimateCapacity', () => {
{
owner_ids: provisionedKibanaInstances,
overdue_non_recurring: 0,
capacity_requirments: {
capacity_requirements: {
per_minute: recurringTasksPerMinute,
per_hour: 0,
per_day: 0,
Expand Down Expand Up @@ -498,7 +498,7 @@ describe('estimateCapacity', () => {
{
owner_ids: 1,
overdue_non_recurring: 0,
capacity_requirments: {
capacity_requirements: {
per_minute: 170,
per_hour: 0,
per_day: 0,
Expand Down Expand Up @@ -562,7 +562,7 @@ describe('estimateCapacity', () => {
{
owner_ids: 1,
overdue_non_recurring: 0,
capacity_requirments: {
capacity_requirements: {
per_minute: 175,
per_hour: 0,
per_day: 0,
Expand Down Expand Up @@ -623,7 +623,7 @@ describe('estimateCapacity', () => {
{
owner_ids: 1,
overdue_non_recurring: 0,
capacity_requirments: {
capacity_requirements: {
per_minute: 210,
per_hour: 0,
per_day: 0,
Expand Down Expand Up @@ -684,7 +684,7 @@ describe('estimateCapacity', () => {
{
owner_ids: 1,
overdue_non_recurring: 0,
capacity_requirments: {
capacity_requirements: {
per_minute: 28,
per_hour: 27,
per_day: 2,
Expand Down Expand Up @@ -759,7 +759,7 @@ describe('estimateCapacity', () => {
{
owner_ids: 1,
overdue_non_recurring: 0,
capacity_requirments: {
capacity_requirements: {
per_minute: 210,
per_hour: 0,
per_day: 0,
Expand Down Expand Up @@ -871,7 +871,7 @@ function mockStats(
estimated_schedule_density: [],
non_recurring: 20,
owner_ids: 2,
capacity_requirments: {
capacity_requirements: {
per_minute: 150,
per_hour: 360,
per_day: 820,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function estimateCapacity(
recurring: percentageOfExecutionsUsedByRecurringTasks,
non_recurring: percentageOfExecutionsUsedByNonRecurringTasks,
} = capacityStats.runtime.value.execution.persistence;
const { overdue, capacity_requirments: capacityRequirments } = workload;
const { overdue, capacity_requirements: capacityRequirements } = workload;
const {
poll_interval: pollInterval,
max_workers: maxWorkers,
Expand Down Expand Up @@ -130,9 +130,9 @@ export function estimateCapacity(
* On average, how many tasks per minute does this cluster need to execute?
*/
const averageRecurringRequiredPerMinute =
capacityRequirments.per_minute +
capacityRequirments.per_hour / 60 +
capacityRequirments.per_day / 24 / 60;
capacityRequirements.per_minute +
capacityRequirements.per_hour / 60 +
capacityRequirements.per_day / 24 / 60;

/**
* how many Kibana are needed solely for the recurring tasks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ describe('Workload Statistics Aggregator', () => {
expect(result.key).toEqual('workload');

expect(result.value).toMatchObject({
capacity_requirments: {
capacity_requirements: {
// these are buckets of required capacity, rather than aggregated requirmenets.
per_minute: 150,
per_hour: 360,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ interface RawWorkloadStat extends JsonObject {
overdue: number;
overdue_non_recurring: number;
estimated_schedule_density: number[];
capacity_requirments: CapacityRequirments;
capacity_requirements: CapacityRequirements;
}

export interface WorkloadStat extends RawWorkloadStat {
Expand All @@ -45,7 +45,7 @@ export interface WorkloadStat extends RawWorkloadStat {
export interface SummarizedWorkloadStat extends RawWorkloadStat {
owner_ids: number;
}
export interface CapacityRequirments extends JsonObject {
export interface CapacityRequirements extends JsonObject {
per_minute: number;
per_hour: number;
per_day: number;
Expand Down Expand Up @@ -277,7 +277,7 @@ export function createWorkloadAggregator(
pollInterval,
scheduleDensity
),
capacity_requirments: {
capacity_requirements: {
per_minute: cadence.perMinute,
per_hour: cadence.perHour,
per_day: cadence.perDay,
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/task_manager/server/routes/health.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ function mockHealthStats(overrides = {}) {
non_recurring: 20,
owner_ids: [0, 0, 0, 1, 2, 0, 0, 2, 2, 2, 1, 2, 1, 1],
estimated_schedule_density: [],
capacity_requirments: {
capacity_requirements: {
per_minute: 150,
per_hour: 360,
per_day: 820,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface MonitoringStats {
non_recurring: number;
owner_ids: number;
estimated_schedule_density: number[];
capacity_requirments: {
capacity_requirements: {
per_minute: number;
per_hour: number;
per_day: number;
Expand Down Expand Up @@ -218,9 +218,9 @@ export default function ({ getService }: FtrProviderContext) {
expect(typeof workload.non_recurring).to.eql('number');
expect(typeof workload.owner_ids).to.eql('number');

expect(typeof workload.capacity_requirments.per_minute).to.eql('number');
expect(typeof workload.capacity_requirments.per_hour).to.eql('number');
expect(typeof workload.capacity_requirments.per_day).to.eql('number');
expect(typeof workload.capacity_requirements.per_minute).to.eql('number');
expect(typeof workload.capacity_requirements.per_hour).to.eql('number');
expect(typeof workload.capacity_requirements.per_day).to.eql('number');

expect(Array.isArray(workload.estimated_schedule_density)).to.eql(true);

Expand Down

0 comments on commit 7cc112d

Please sign in to comment.