chore(package): use constants in configuration schema

This commit is contained in:
Julien Fontanet 2016-10-18 17:31:46 +02:00
parent 2b8996e965
commit 2a316b1ffa
2 changed files with 8 additions and 4 deletions

View File

@ -5,6 +5,10 @@ import { intersection, map as mapToArray, uniq } from 'lodash'
import DensityPlan from './density-plan' import DensityPlan from './density-plan'
import PerformancePlan from './performance-plan' import PerformancePlan from './performance-plan'
import {
DEFAULT_CRITICAL_THRESHOLD_CPU,
DEFAULT_CRITICAL_THRESHOLD_MEMORY_FREE
} from './plan'
import { import {
EXECUTION_DELAY, EXECUTION_DELAY,
debug debug
@ -61,12 +65,12 @@ export const configurationSchema = {
cpu: { cpu: {
type: 'integer', type: 'integer',
title: 'CPU (%)', title: 'CPU (%)',
default: 90 default: DEFAULT_CRITICAL_THRESHOLD_CPU
}, },
memoryFree: { memoryFree: {
type: 'integer', type: 'integer',
title: 'RAM, Free memory (MB)', title: 'RAM, Free memory (MB)',
default: 64 default: DEFAULT_CRITICAL_THRESHOLD_MEMORY_FREE
} }
} }
}, },

View File

@ -8,10 +8,10 @@ import {
const MINUTES_OF_HISTORICAL_DATA = 30 const MINUTES_OF_HISTORICAL_DATA = 30
// CPU threshold in percent. // CPU threshold in percent.
const DEFAULT_CRITICAL_THRESHOLD_CPU = 90.0 export const DEFAULT_CRITICAL_THRESHOLD_CPU = 90.0
// Memory threshold in MB. // Memory threshold in MB.
const DEFAULT_CRITICAL_THRESHOLD_MEMORY_FREE = 64.0 export const DEFAULT_CRITICAL_THRESHOLD_MEMORY_FREE = 64.0
// Thresholds factors. // Thresholds factors.
const HIGH_THRESHOLD_FACTOR = 0.85 const HIGH_THRESHOLD_FACTOR = 0.85