Analytics graphs (#2892)
* Added radial chart in analytics Signed-off-by: Saranya-jena <saranya@chaosnative.com> * Added backend API for schedule stats Signed-off-by: Saranya-jena <saranya@chaosnative.com> * Prepended result and rounded of values for monthly data Signed-off-by: Saranya-jena <saranya@chaosnative.com> * Added documentation, filtering for weekly and hourly workflow schedule data Signed-off-by: Saranya-jena <saranya@chaosnative.com> * Graph WIP, query added, data format typed and formatting fixed Signed-off-by: Vansh Bhatia <vansh@chaosnative.com> * Added frontend integration for schedule stats graph Signed-off-by: Saranya-jena <saranya@chaosnative.com> * Backend - Schedule stats bug fixed and Run stats included in the same query Signed-off-by: arkajyotiMukherjee <arko@chaosnative.com> * Added frontend integration for run stats graph Signed-off-by: Saranya-jena <saranya@chaosnative.com> * resolved merge conflicts Signed-off-by: Saranya-jena <saranya@chaosnative.com> * fixed the import error in backend Signed-off-by: Saranya-jena <saranya@chaosnative.com> * deleted unused file Signed-off-by: Saranya-jena <saranya@chaosnative.com> * Changed the variables' names Signed-off-by: Saranya-jena <saranya@chaosnative.com> * Added interfaces from litmus-ui Signed-off-by: Saranya-jena <saranya@chaosnative.com> Co-authored-by: Vansh Bhatia <vansh@chaosnative.com> Co-authored-by: arkajyotiMukherjee <arko@chaosnative.com>
This commit is contained in:
parent
3ef78a10e3
commit
673a368454
|
@ -40,6 +40,23 @@ export const WORKFLOW_DETAILS = gql`
|
|||
}
|
||||
`;
|
||||
|
||||
export const WORKFLOW_STATS = gql`
|
||||
query getScheduledWorkflowStats(
|
||||
$filter: TimeFrequency!
|
||||
$project_id: String!
|
||||
$show_workflow_runs: Boolean!
|
||||
) {
|
||||
getScheduledWorkflowStats(
|
||||
filter: $filter
|
||||
project_id: $project_id
|
||||
show_workflow_runs: $show_workflow_runs
|
||||
) {
|
||||
date
|
||||
value
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const WORKFLOW_LIST_DETAILS = gql`
|
||||
query workflowListDetails($workflowInput: ListWorkflowsInput!) {
|
||||
ListWorkflow(workflowInput: $workflowInput) {
|
||||
|
|
|
@ -23,3 +23,24 @@ export interface ScheduleWorkflow {
|
|||
export interface DeleteSchedule {
|
||||
workflow_id: string;
|
||||
}
|
||||
|
||||
export interface WorkflowStatsVars {
|
||||
filter: Filter;
|
||||
project_id: string;
|
||||
show_workflow_runs: boolean;
|
||||
}
|
||||
|
||||
export interface DateValue {
|
||||
date: number;
|
||||
value: number;
|
||||
}
|
||||
|
||||
export interface WorkflowStatsResponse {
|
||||
getScheduledWorkflowStats: Array<DateValue>;
|
||||
}
|
||||
|
||||
export enum Filter {
|
||||
monthly = 'Monthly',
|
||||
weekly = 'Weekly',
|
||||
hourly = 'Hourly',
|
||||
}
|
||||
|
|
|
@ -196,9 +196,11 @@ const Overview: React.FC = () => {
|
|||
if (dataSourceListError || workflowError || dashboardListError) {
|
||||
console.error('Error fetching the data!');
|
||||
return (
|
||||
<Center>
|
||||
<Typography>Error fetching the data!</Typography>
|
||||
</Center>
|
||||
<div style={{ height: '50vh' }}>
|
||||
<Center>
|
||||
<Typography>Error fetching the data!</Typography>
|
||||
</Center>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ import {
|
|||
sortNumDesc,
|
||||
} from '../../../../utils/sort';
|
||||
import ResilienceScoreComparisonPlot from '../WorkflowComparisonPlot/index';
|
||||
import WorkflowGraphs from '../WorkflowGraphs';
|
||||
import useStyles from './styles';
|
||||
import TableData from './TableData';
|
||||
import TableHeader from './TableHeader';
|
||||
|
@ -629,6 +630,7 @@ const WorkflowComparisonTable = () => {
|
|||
|
||||
return (
|
||||
<div className={classes.root} id="analytics">
|
||||
<WorkflowGraphs data={data} />
|
||||
<div className={classes.analyticsDiv}>
|
||||
<Typography className={classes.heading}>
|
||||
<strong>
|
||||
|
|
|
@ -0,0 +1,136 @@
|
|||
import { useQuery } from '@apollo/client';
|
||||
import { Paper, Tabs, useTheme } from '@material-ui/core';
|
||||
import { GraphMetric, LineAreaGraph } from 'litmus-ui';
|
||||
import React, { useState } from 'react';
|
||||
import { StyledTab, TabPanel } from '../../../../../components/Tabs';
|
||||
import { WORKFLOW_STATS } from '../../../../../graphql';
|
||||
import {
|
||||
DateValue,
|
||||
Filter,
|
||||
WorkflowStatsResponse,
|
||||
WorkflowStatsVars,
|
||||
} from '../../../../../models/graphql/scheduleData';
|
||||
import { getProjectID } from '../../../../../utils/getSearchParams';
|
||||
import useStyles from './style';
|
||||
|
||||
// tabProps returns 'id' and 'aria-control' props of Tab
|
||||
function tabProps(index: any) {
|
||||
return {
|
||||
id: `simple-tab-${index}`,
|
||||
'aria-controls': `simple-tabpanel-${index}`,
|
||||
};
|
||||
}
|
||||
|
||||
interface ScheduleAndRunStatsProps {
|
||||
filter: Filter;
|
||||
}
|
||||
|
||||
const ScheduleAndRunStats: React.FC<ScheduleAndRunStatsProps> = ({
|
||||
filter,
|
||||
}) => {
|
||||
const classes = useStyles();
|
||||
const projectID = getProjectID();
|
||||
const theme = useTheme();
|
||||
const [activeTab, setActiveTab] = React.useState(0);
|
||||
const handleChange = (event: React.ChangeEvent<{}>, actTab: number) => {
|
||||
setActiveTab(actTab);
|
||||
};
|
||||
|
||||
const [graphDataState, setGraphDataState] = useState<DateValue[]>([]);
|
||||
|
||||
const tempGraphData: Array<DateValue> = [];
|
||||
|
||||
useQuery<WorkflowStatsResponse, WorkflowStatsVars>(WORKFLOW_STATS, {
|
||||
variables: {
|
||||
filter,
|
||||
project_id: projectID,
|
||||
show_workflow_runs: activeTab === 0,
|
||||
},
|
||||
onCompleted: (dateValueData) => {
|
||||
dateValueData.getScheduledWorkflowStats.map((data) =>
|
||||
tempGraphData.push({
|
||||
date: data.date,
|
||||
value: data.value,
|
||||
})
|
||||
);
|
||||
setGraphDataState(tempGraphData);
|
||||
},
|
||||
});
|
||||
|
||||
const closedSeriesData: Array<GraphMetric> = [
|
||||
{
|
||||
metricName: activeTab === 0 ? 'Runs' : 'Schedules',
|
||||
data: graphDataState,
|
||||
baseColor: activeTab === 0 ? '#F6793E' : '#5B44BA',
|
||||
},
|
||||
];
|
||||
|
||||
function xAxisTimeFormat(filter: Filter) {
|
||||
switch (filter) {
|
||||
case Filter.monthly:
|
||||
return 'MMM';
|
||||
case Filter.weekly:
|
||||
return '[W] W';
|
||||
case Filter.hourly:
|
||||
return 'HH[hrs]';
|
||||
default:
|
||||
return 'MMM';
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Paper elevation={0}>
|
||||
<Paper className={classes.workflowGraphs}>
|
||||
<Tabs
|
||||
value={activeTab}
|
||||
onChange={handleChange}
|
||||
TabIndicatorProps={{
|
||||
style: {
|
||||
backgroundColor: theme.palette.primary.main,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<StyledTab
|
||||
data-cy="receivedTab"
|
||||
label=" Run stats"
|
||||
{...tabProps(1)}
|
||||
/>
|
||||
<StyledTab
|
||||
data-cy="activeTab"
|
||||
label="Schedule stats"
|
||||
{...tabProps(0)}
|
||||
/>
|
||||
</Tabs>
|
||||
<TabPanel value={activeTab} index={0}>
|
||||
<div className={classes.graphContainer}>
|
||||
<LineAreaGraph
|
||||
closedSeries={closedSeriesData}
|
||||
showLegendTable={false}
|
||||
showPoints
|
||||
showTips
|
||||
showMultiToolTip
|
||||
yLabelOffset={35}
|
||||
xAxistimeFormat={xAxisTimeFormat(filter)}
|
||||
/>
|
||||
</div>
|
||||
</TabPanel>
|
||||
<TabPanel value={activeTab} index={1}>
|
||||
<div className={classes.graphContainer}>
|
||||
<LineAreaGraph
|
||||
closedSeries={closedSeriesData}
|
||||
showLegendTable={false}
|
||||
showPoints
|
||||
showTips
|
||||
showMultiToolTip
|
||||
yLabelOffset={35}
|
||||
xAxistimeFormat={xAxisTimeFormat(filter)}
|
||||
/>
|
||||
</div>
|
||||
</TabPanel>
|
||||
</Paper>
|
||||
</Paper>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default ScheduleAndRunStats;
|
|
@ -0,0 +1,16 @@
|
|||
import { makeStyles, Theme } from '@material-ui/core/styles';
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) => ({
|
||||
workflowGraphs: {
|
||||
padding: theme.spacing(3.125, 3.75, 3.125, 10),
|
||||
height: '100%',
|
||||
marginBottom: theme.spacing(3.125),
|
||||
},
|
||||
graphContainer: {
|
||||
width: '900px',
|
||||
height: '320px',
|
||||
marginLeft: '-70px',
|
||||
marginBottom: '25px',
|
||||
},
|
||||
}));
|
||||
export default useStyles;
|
|
@ -0,0 +1,87 @@
|
|||
import {
|
||||
FormControl,
|
||||
InputLabel,
|
||||
MenuItem,
|
||||
Paper,
|
||||
Select,
|
||||
} from '@material-ui/core';
|
||||
import { RadialChart, RadialChartMetric } from 'litmus-ui';
|
||||
import React, { useState } from 'react';
|
||||
import { Filter } from '../../../../models/graphql/scheduleData';
|
||||
import {
|
||||
ExecutionData,
|
||||
ScheduledWorkflows,
|
||||
} from '../../../../models/graphql/workflowListData';
|
||||
import ScheduleAndRunStats from './ScheduleAndRunStats';
|
||||
import useStyles from './styles';
|
||||
|
||||
interface WorkflowGraphsProps {
|
||||
data: ScheduledWorkflows | undefined;
|
||||
}
|
||||
|
||||
const WorkflowGraphs: React.FC<WorkflowGraphsProps> = ({ data }) => {
|
||||
const classes = useStyles();
|
||||
|
||||
let completed = 0;
|
||||
let running = 0;
|
||||
let failed = 0;
|
||||
|
||||
/* eslint-disable no-unused-expressions */
|
||||
data?.ListWorkflow.workflows.map((datarow) =>
|
||||
datarow.workflow_runs?.map((runs) => {
|
||||
if (
|
||||
(JSON.parse(runs.execution_data) as ExecutionData).phase === 'Succeeded'
|
||||
)
|
||||
completed++;
|
||||
else if (
|
||||
(JSON.parse(runs.execution_data) as ExecutionData).phase === 'Running'
|
||||
)
|
||||
running++;
|
||||
else if (
|
||||
(JSON.parse(runs.execution_data) as ExecutionData).phase === 'Failed'
|
||||
)
|
||||
failed++;
|
||||
})
|
||||
);
|
||||
|
||||
// States for filters
|
||||
const [filters, setFilters] = useState<Filter>(Filter.monthly);
|
||||
|
||||
const graphData: RadialChartMetric[] = [
|
||||
{ value: completed, label: 'Completed', baseColor: '#00CC9A' },
|
||||
{ value: running, label: 'Running', baseColor: '#5252F6' },
|
||||
{ value: failed, label: 'Failed', baseColor: '#CA2C2C' },
|
||||
];
|
||||
return (
|
||||
<div>
|
||||
<Paper className={classes.paper}>
|
||||
<FormControl variant="outlined" className={classes.formControl} focused>
|
||||
<InputLabel className={classes.selectText} />
|
||||
<Select
|
||||
value={filters}
|
||||
onChange={(event) => {
|
||||
setFilters(event.target.value as Filter);
|
||||
}}
|
||||
className={classes.selectText}
|
||||
>
|
||||
<MenuItem value={Filter.monthly}>Monthly</MenuItem>
|
||||
<MenuItem value={Filter.weekly}>Weekly</MenuItem>
|
||||
<MenuItem value={Filter.hourly}>Hourly</MenuItem>
|
||||
</Select>
|
||||
</FormControl>
|
||||
<div className={classes.root}>
|
||||
<ScheduleAndRunStats filter={filters} />
|
||||
<Paper className={classes.radialChartContainer}>
|
||||
<RadialChart
|
||||
radialData={graphData}
|
||||
heading="Workflows"
|
||||
showCenterHeading
|
||||
/>
|
||||
</Paper>
|
||||
</div>
|
||||
</Paper>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default WorkflowGraphs;
|
|
@ -0,0 +1,36 @@
|
|||
import { makeStyles } from '@material-ui/core';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
paper: {
|
||||
padding: theme.spacing(2),
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'flex-end',
|
||||
marginBottom: theme.spacing(3.5),
|
||||
},
|
||||
root: {
|
||||
width: '100%',
|
||||
padding: theme.spacing(4.375),
|
||||
display: 'flex',
|
||||
justifyContent: 'space-between',
|
||||
flexWrap: 'wrap',
|
||||
},
|
||||
radialChartContainer: {
|
||||
width: '22rem',
|
||||
borderRadius: '0.1875rem',
|
||||
marginBottom: theme.spacing(3.125),
|
||||
},
|
||||
selectText: {
|
||||
height: '2.5rem',
|
||||
padding: theme.spacing(0.5),
|
||||
},
|
||||
formControl: {
|
||||
margin: theme.spacing(1, 3, 0, 2),
|
||||
minWidth: '9rem',
|
||||
'& fieldset': {
|
||||
height: '3.1875rem',
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
||||
export default useStyles;
|
|
@ -76,7 +76,6 @@ github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4Rq
|
|||
github.com/agnivade/levenshtein v1.0.3 h1:M5ZnqLOoZR8ygVq0FfkXsNOKzMCk0xRiow0R5+5VkQ0=
|
||||
github.com/agnivade/levenshtein v1.0.3/go.mod h1:4SFRZbbXWLF4MU1T9Qg0pGgH3Pjs+t6ie5efyrwRJXs=
|
||||
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
|
||||
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs=
|
||||
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
|
@ -84,16 +83,13 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF
|
|||
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
|
||||
github.com/aliyun/aliyun-oss-go-sdk v2.0.6+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
|
||||
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
|
||||
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
|
||||
github.com/ant31/crd-validation v0.0.0-20180702145049-30f8a35d0ac2/go.mod h1:X0noFIik9YqfhGYBLEHg8LJKEwy7QIitLQuFMpKLcPk=
|
||||
github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q=
|
||||
github.com/antonmedv/expr v1.8.2/go.mod h1:5qsM3oLGDND7sDmQGDXHkYfkjYMUX14qsgqmHhwGEk8=
|
||||
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
|
||||
github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
|
||||
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q=
|
||||
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE=
|
||||
github.com/argoproj/argo v0.0.0-20200806220847-5759a0e198d3 h1:UbCWw+VjeyicEGnFvBIGzOYCKuCqrRUzlxSbzaHcXug=
|
||||
github.com/argoproj/argo v0.0.0-20200806220847-5759a0e198d3/go.mod h1:M0Up9o5uqIZvRh/vh8eJR27s6H+UlkiS1PBUQAIq4Hw=
|
||||
|
@ -102,7 +98,6 @@ github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hC
|
|||
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
|
||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
||||
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
|
||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
|
||||
github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A=
|
||||
github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||
|
@ -119,7 +114,6 @@ github.com/bazelbuild/bazel-gazelle v0.0.0-20181012220611-c728ce9f663e/go.mod h1
|
|||
github.com/bazelbuild/buildtools v0.0.0-20180226164855-80c7f0d45d7e/go.mod h1:5JP0TXzWDHXv8qvxRC4InIazwdyDseBDbzESUMKk1yU=
|
||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||
github.com/bifurcation/mint v0.0.0-20180715133206-93c51c6ce115/go.mod h1:zVt7zX3K/aDCk9Tj+VM7YymsX66ERvzCJzw8rFCX2JU=
|
||||
|
@ -140,10 +134,8 @@ github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QH
|
|||
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/cespare/prettybench v0.0.0-20150116022406-03b8cfe5406c/go.mod h1:Xe6ZsFhtM8HrDku0pxJ3/Lr51rwykrzgFwpmTzleatY=
|
||||
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
|
||||
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
||||
github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM=
|
||||
github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
|
||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw=
|
||||
github.com/checkpoint-restore/go-criu v0.0.0-20190109184317-bdb7599cd87b/go.mod h1:TrMrLQfeENAPYPRsJuq3jsqdlRh3lvi6trTZJG8+tho=
|
||||
|
@ -217,7 +209,6 @@ github.com/denisenkom/go-mssqldb v0.0.0-20190515213511-eb9f6a1743f3/go.mod h1:zA
|
|||
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
|
||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
|
||||
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
|
||||
github.com/dgryski/trifles v0.0.0-20190318185328-a8d75aae118c h1:TUuUh0Xgj97tLMNtWtNvI9mIV6isjEb9lBMNv+77IGM=
|
||||
github.com/dgryski/trifles v0.0.0-20190318185328-a8d75aae118c/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA=
|
||||
github.com/dhui/dktest v0.3.0/go.mod h1:cyzIUfGsBEbZ6BT7tnXqAShHSXCZhSNmFl70sZ7c1yc=
|
||||
github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
|
||||
|
@ -259,7 +250,6 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7
|
|||
github.com/euank/go-kmsg-parser v2.0.0+incompatible/go.mod h1:MhmAMZ8V4CYH4ybgdRwPr2TU5ThnS43puaKEMpja1uw=
|
||||
github.com/evanphx/json-patch v4.1.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
|
||||
github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
|
||||
github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M=
|
||||
github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
|
||||
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4=
|
||||
github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8=
|
||||
|
@ -269,13 +259,11 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv
|
|||
github.com/fatih/structs v1.0.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
|
||||
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
|
||||
github.com/fatih/structtag v1.1.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94=
|
||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ=
|
||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
|
||||
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
|
||||
github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4=
|
||||
github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
|
||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||
github.com/fsouza/fake-gcs-server v1.7.0/go.mod h1:5XIRs4YvwNbNoz+1JF8j6KLAyDh7RHGAyAK3EP2EsNk=
|
||||
github.com/garyburd/redigo v1.6.0/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY=
|
||||
|
@ -287,7 +275,6 @@ github.com/ghodss/yaml v0.0.0-20180820084758-c7ce16629ff4/go.mod h1:4dBDuWmgqj2H
|
|||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 h1:Mn26/9ZMNWSw9C9ERFA1PUxfmGpolnw2v0bKOREu5ew=
|
||||
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32/go.mod h1:GIjDIg/heH5DOkXY3YJ/wNhfHsQHoXGjl8G8amsYQ1I=
|
||||
github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0=
|
||||
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
|
||||
github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
|
||||
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
|
||||
|
@ -298,7 +285,6 @@ github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4=
|
|||
github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E=
|
||||
github.com/go-git/go-billy/v5 v5.0.0 h1:7NQHvd9FVid8VL4qVUMm8XifBK+2xCoZ2lSk0agRrHM=
|
||||
github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
|
||||
github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12 h1:PbKy9zOy4aAKrJ5pibIRpVO2BXnK1Tlcg+caKI7Ox5M=
|
||||
github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw=
|
||||
github.com/go-git/go-git/v5 v5.2.0 h1:YPBLG/3UK1we1ohRkncLjaXWLW+HKp5QNM/jTli2JgI=
|
||||
github.com/go-git/go-git/v5 v5.2.0/go.mod h1:kh02eMX+wdqqxgNMEyq8YgwlIOsDOa9homkUq1PoTMs=
|
||||
|
@ -456,7 +442,6 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a
|
|||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
|
||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
|
||||
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
||||
|
@ -548,7 +533,6 @@ github.com/heketi/rest v0.0.0-20180404230133-aa6a65207413/go.mod h1:BeS3M108VzVl
|
|||
github.com/heketi/tests v0.0.0-20151005000721-f3775cbcefd6/go.mod h1:xGMAM8JLi7UkZt1i4FQeQy0R2T8GLUwQhOP5M1gBhy4=
|
||||
github.com/heketi/utils v0.0.0-20170317161834-435bc5bdfa64/go.mod h1:RYlF4ghFZPPmk2TC5REt5OFwvfb6lzxFWrTWB+qs28s=
|
||||
github.com/helm/helm-2to3 v0.2.0/go.mod h1:jQUVAWB0bM7zNIqKPIfHFzuFSK0kHYovJrjO+hqcvRk=
|
||||
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4=
|
||||
github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg=
|
||||
|
@ -581,7 +565,6 @@ github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhB
|
|||
github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8=
|
||||
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
|
||||
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
|
||||
github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=
|
||||
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
|
||||
github.com/jpillora/go-ogle-analytics v0.0.0-20161213085824-14b04e0594ef/go.mod h1:PlwhC7q1VSK73InDzdDatVetQrTsQHIbOvcJAZzitY0=
|
||||
github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
|
@ -617,7 +600,6 @@ github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM52
|
|||
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
|
@ -626,7 +608,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
|||
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
|
||||
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/kshvakov/clickhouse v1.3.5/go.mod h1:DMzX7FxRymoNkVgizH0DWAL8Cur7wHLgx3MUnGwJqpE=
|
||||
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
|
||||
|
@ -644,6 +625,7 @@ github.com/litmuschaos/chaos-scheduler v0.0.0-20210607090343-9952190ad032 h1:Nza
|
|||
github.com/litmuschaos/chaos-scheduler v0.0.0-20210607090343-9952190ad032/go.mod h1:7EO6kbZKeJGKzkchgQepCxywvqNFNvNHW0G+u9923AY=
|
||||
github.com/litmuschaos/elves v0.0.0-20201107015738-552d74669e3c/go.mod h1:DsbHGNUq/78NZozWVVI9Q6eBei4I+JjlkkD5aibJ3MQ=
|
||||
github.com/litmuschaos/litmus v0.0.0-20210614060828-454347e15c01 h1:UAkWlQRwDcP/MWlJiMZ20vWWc+fmVVK8hAxjd8DpjAA=
|
||||
github.com/litmuschaos/litmus v0.0.0-20210614085358-3ef78a10e32b h1:+LhWl0rj/1mT6QUB8VUqnhujcuik2/zOoAuYrtnMAPk=
|
||||
github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
|
||||
github.com/lpabon/godbc v0.1.1/go.mod h1:Jo9QV0cf3U6jZABgiJ2skINAXb9j8m51r07g4KI92ZA=
|
||||
github.com/lucas-clemente/aes12 v0.0.0-20171027163421-cd47fb39b79f/go.mod h1:JpH9J1c9oX6otFSgdUHwUBUizmKlrMjxWnIAjff4m04=
|
||||
|
@ -686,7 +668,6 @@ github.com/mattn/go-runewidth v0.0.8/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m
|
|||
github.com/mattn/go-shellwords v1.0.5/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o=
|
||||
github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
||||
github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.1/go.mod h1:F9YacGpnZbLQMzuPI0rR6op21YvNu/RjL705LJJpM3k=
|
||||
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY=
|
||||
|
@ -732,7 +713,6 @@ github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8m
|
|||
github.com/munnerz/goautoneg v0.0.0-20190414153302-2ae31c8b6b30/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||
github.com/mvdan/xurls v1.1.0/go.mod h1:tQlNn3BED8bE/15hnSL2HLkDeLWpNPAwtw7wkEq44oU=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
|
||||
github.com/nakagami/firebirdsql v0.0.0-20190310045651-3c02a58cfed8/go.mod h1:86wM1zFnC6/uDBfZGNwB65O+pR2OFi5q/YQaEUid1qA=
|
||||
|
@ -745,7 +725,6 @@ github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzE
|
|||
github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
|
||||
github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
|
||||
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs=
|
||||
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
|
||||
|
@ -756,13 +735,11 @@ github.com/onsi/ginkgo v1.4.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W
|
|||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.10.1 h1:q/mM8GF/n0shIN8SaAZ0V+jnLPzen6WIVZdiwrRlMlo=
|
||||
github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
|
||||
github.com/onsi/gomega v1.3.0/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME=
|
||||
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
|
||||
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
|
||||
|
@ -815,7 +792,6 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
|||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA=
|
||||
github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
|
||||
github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
|
||||
|
@ -837,7 +813,6 @@ github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:
|
|||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
|
||||
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
|
||||
github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
|
||||
|
@ -860,7 +835,6 @@ github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDa
|
|||
github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
|
||||
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
|
||||
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
|
||||
github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4=
|
||||
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
|
||||
github.com/prometheus/prometheus v2.3.2+incompatible/go.mod h1:oAIUtOny2rjMX0OWN5vPR5/q/twIROJvdqnQKDdil/s=
|
||||
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
|
||||
|
@ -949,7 +923,6 @@ github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
|
|||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/syndtr/gocapability v0.0.0-20160928074757-e7cb7fa329f4/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
|
||||
github.com/thecodeteam/goscaleio v0.1.0/go.mod h1:68sdkZAsK8bvEwBlbQnlLS+xU+hvLYM/iQ8KXej1AwM=
|
||||
|
@ -1327,7 +1300,6 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7
|
|||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
||||
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc=
|
||||
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190128161407-8ac453e89fca/go.mod h1:L3J43x8/uS+qIUoksaLKe6OS3nUKxOKuIFz1sl2/jx4=
|
||||
|
@ -1380,11 +1352,9 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks
|
|||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/gcfg.v1 v1.2.0/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o=
|
||||
gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o=
|
||||
|
@ -1408,11 +1378,9 @@ gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76
|
|||
gopkg.in/square/go-jose.v2 v2.5.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
|
||||
gopkg.in/src-d/go-billy.v4 v4.3.2 h1:0SQA1pRztfTFx2miS8sA97XvooFeNOmvUenF4o0EcVg=
|
||||
gopkg.in/src-d/go-billy.v4 v4.3.2/go.mod h1:nDjArDMp+XMs1aFAESLRjfGSgfvoYN0hDfzEk0GjC98=
|
||||
gopkg.in/src-d/go-git-fixtures.v3 v3.5.0 h1:ivZFOIltbce2Mo8IjzUHAFoq/IylO9WHhNOAJK+LsJg=
|
||||
gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g=
|
||||
gopkg.in/src-d/go-git.v4 v4.13.1 h1:SRtFyV8Kxc0UP7aCHcijOMQGPxHSmMOPrzulQWolkYE=
|
||||
gopkg.in/src-d/go-git.v4 v4.13.1/go.mod h1:nx5NYcxdKxq5fpltdHnPa2Exj4Sx0EclMWZQbYDu2z8=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/warnings.v0 v0.1.1/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
|
||||
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
|
||||
|
|
|
@ -1,258 +1,269 @@
|
|||
input DSInput {
|
||||
ds_id: String
|
||||
ds_name: String!
|
||||
ds_type: String!
|
||||
ds_url: String!
|
||||
access_type: String!
|
||||
auth_type: String!
|
||||
basic_auth_username: String
|
||||
basic_auth_password: String
|
||||
scrape_interval: Int!
|
||||
query_timeout: Int!
|
||||
http_method: String!
|
||||
project_id: String
|
||||
ds_id: String
|
||||
ds_name: String!
|
||||
ds_type: String!
|
||||
ds_url: String!
|
||||
access_type: String!
|
||||
auth_type: String!
|
||||
basic_auth_username: String
|
||||
basic_auth_password: String
|
||||
scrape_interval: Int!
|
||||
query_timeout: Int!
|
||||
http_method: String!
|
||||
project_id: String
|
||||
}
|
||||
|
||||
type DSResponse {
|
||||
ds_id: String
|
||||
ds_name: String
|
||||
ds_type: String
|
||||
ds_url: String
|
||||
access_type: String
|
||||
auth_type: String
|
||||
basic_auth_username: String
|
||||
basic_auth_password: String
|
||||
scrape_interval: Int
|
||||
query_timeout: Int
|
||||
http_method: String
|
||||
project_id: ID!
|
||||
health_status: String!
|
||||
created_at: String
|
||||
updated_at: String
|
||||
ds_id: String
|
||||
ds_name: String
|
||||
ds_type: String
|
||||
ds_url: String
|
||||
access_type: String
|
||||
auth_type: String
|
||||
basic_auth_username: String
|
||||
basic_auth_password: String
|
||||
scrape_interval: Int
|
||||
query_timeout: Int
|
||||
http_method: String
|
||||
project_id: ID!
|
||||
health_status: String!
|
||||
created_at: String
|
||||
updated_at: String
|
||||
}
|
||||
|
||||
input createDBInput {
|
||||
ds_id: String!
|
||||
db_name: String!
|
||||
db_type_name: String!
|
||||
db_type_id: String!
|
||||
db_information: String
|
||||
chaos_event_query_template: String!
|
||||
chaos_verdict_query_template: String!
|
||||
application_metadata_map: [applicationMetadata]
|
||||
panel_groups: [panelGroup]!
|
||||
end_time: String!
|
||||
start_time: String!
|
||||
project_id: ID!
|
||||
cluster_id: ID!
|
||||
refresh_rate: String!
|
||||
ds_id: String!
|
||||
db_name: String!
|
||||
db_type_name: String!
|
||||
db_type_id: String!
|
||||
db_information: String
|
||||
chaos_event_query_template: String!
|
||||
chaos_verdict_query_template: String!
|
||||
application_metadata_map: [applicationMetadata]
|
||||
panel_groups: [panelGroup]!
|
||||
end_time: String!
|
||||
start_time: String!
|
||||
project_id: ID!
|
||||
cluster_id: ID!
|
||||
refresh_rate: String!
|
||||
}
|
||||
|
||||
input applicationMetadata {
|
||||
namespace: String!
|
||||
applications: [resource]
|
||||
namespace: String!
|
||||
applications: [resource]
|
||||
}
|
||||
|
||||
input resource {
|
||||
kind: String!
|
||||
names: [String]
|
||||
kind: String!
|
||||
names: [String]
|
||||
}
|
||||
|
||||
input updateDBInput {
|
||||
db_id: String!
|
||||
ds_id: String!
|
||||
db_name: String!
|
||||
db_type_name: String!
|
||||
db_type_id: String!
|
||||
db_information: String
|
||||
chaos_event_query_template: String!
|
||||
chaos_verdict_query_template: String!
|
||||
application_metadata_map: [applicationMetadata]
|
||||
panel_groups: [updatePanelGroupInput]!
|
||||
end_time: String!
|
||||
start_time: String!
|
||||
cluster_id: ID!
|
||||
refresh_rate: String!
|
||||
db_id: String!
|
||||
ds_id: String!
|
||||
db_name: String!
|
||||
db_type_name: String!
|
||||
db_type_id: String!
|
||||
db_information: String
|
||||
chaos_event_query_template: String!
|
||||
chaos_verdict_query_template: String!
|
||||
application_metadata_map: [applicationMetadata]
|
||||
panel_groups: [updatePanelGroupInput]!
|
||||
end_time: String!
|
||||
start_time: String!
|
||||
cluster_id: ID!
|
||||
refresh_rate: String!
|
||||
}
|
||||
|
||||
input updatePanelGroupInput {
|
||||
panel_group_name: String!
|
||||
panel_group_id: String!
|
||||
panels: [panel]
|
||||
panel_group_name: String!
|
||||
panel_group_id: String!
|
||||
panels: [panel]
|
||||
}
|
||||
|
||||
input panelGroup {
|
||||
panels: [panel]
|
||||
panel_group_name: String!
|
||||
panels: [panel]
|
||||
panel_group_name: String!
|
||||
}
|
||||
|
||||
input panel {
|
||||
panel_id: String
|
||||
db_id: String
|
||||
y_axis_left: String
|
||||
y_axis_right: String
|
||||
x_axis_down: String
|
||||
unit: String
|
||||
panel_group_id: String
|
||||
created_at: String
|
||||
prom_queries: [promQuery]
|
||||
panel_options: panelOption
|
||||
panel_name: String!
|
||||
panel_id: String
|
||||
db_id: String
|
||||
y_axis_left: String
|
||||
y_axis_right: String
|
||||
x_axis_down: String
|
||||
unit: String
|
||||
panel_group_id: String
|
||||
created_at: String
|
||||
prom_queries: [promQuery]
|
||||
panel_options: panelOption
|
||||
panel_name: String!
|
||||
}
|
||||
|
||||
input panelOption {
|
||||
points: Boolean
|
||||
grids: Boolean
|
||||
left_axis: Boolean
|
||||
points: Boolean
|
||||
grids: Boolean
|
||||
left_axis: Boolean
|
||||
}
|
||||
|
||||
input promQuery {
|
||||
queryid: String!
|
||||
prom_query_name: String,
|
||||
legend: String,
|
||||
resolution: String,
|
||||
minstep: String,
|
||||
line: Boolean
|
||||
close_area: Boolean
|
||||
queryid: String!
|
||||
prom_query_name: String
|
||||
legend: String
|
||||
resolution: String
|
||||
minstep: String
|
||||
line: Boolean
|
||||
close_area: Boolean
|
||||
}
|
||||
|
||||
input promInput {
|
||||
queries: [promQueryInput]
|
||||
ds_details: dsDetails!
|
||||
queries: [promQueryInput]
|
||||
ds_details: dsDetails!
|
||||
}
|
||||
|
||||
input promSeriesInput {
|
||||
series: String!
|
||||
ds_details: dsDetails!
|
||||
series: String!
|
||||
ds_details: dsDetails!
|
||||
}
|
||||
|
||||
input dsDetails {
|
||||
url: String!
|
||||
start: String!
|
||||
end: String!
|
||||
url: String!
|
||||
start: String!
|
||||
end: String!
|
||||
}
|
||||
|
||||
input promQueryInput {
|
||||
queryid: String!
|
||||
query: String!
|
||||
legend: String
|
||||
resolution: String
|
||||
minstep: Int!
|
||||
queryid: String!
|
||||
query: String!
|
||||
legend: String
|
||||
resolution: String
|
||||
minstep: Int!
|
||||
}
|
||||
|
||||
type metricsPromResponse {
|
||||
queryid: String!
|
||||
legends: [String]
|
||||
tsvs: [[metricsTimeStampValue]]
|
||||
queryid: String!
|
||||
legends: [String]
|
||||
tsvs: [[metricsTimeStampValue]]
|
||||
}
|
||||
|
||||
type metricsTimeStampValue{
|
||||
date: Float
|
||||
value: Float
|
||||
type metricsTimeStampValue {
|
||||
date: Float
|
||||
value: Float
|
||||
}
|
||||
|
||||
type annotationsPromResponse {
|
||||
queryid: String!
|
||||
legends: [String]
|
||||
tsvs: [[annotationsTimeStampValue]]
|
||||
queryid: String!
|
||||
legends: [String]
|
||||
tsvs: [[annotationsTimeStampValue]]
|
||||
}
|
||||
|
||||
type annotationsTimeStampValue{
|
||||
date: Float
|
||||
value: Int
|
||||
type annotationsTimeStampValue {
|
||||
date: Float
|
||||
value: Int
|
||||
}
|
||||
|
||||
type promResponse {
|
||||
metricsResponse: [metricsPromResponse]
|
||||
annotationsResponse: [annotationsPromResponse]
|
||||
metricsResponse: [metricsPromResponse]
|
||||
annotationsResponse: [annotationsPromResponse]
|
||||
}
|
||||
|
||||
type promSeriesResponse {
|
||||
series: String!
|
||||
labelValues: [labelValue]
|
||||
series: String!
|
||||
labelValues: [labelValue]
|
||||
}
|
||||
|
||||
type promSeriesListResponse {
|
||||
seriesList: [String]
|
||||
seriesList: [String]
|
||||
}
|
||||
|
||||
type labelValue {
|
||||
label: String!
|
||||
values: [option]
|
||||
label: String!
|
||||
values: [option]
|
||||
}
|
||||
|
||||
type option {
|
||||
name: String!
|
||||
name: String!
|
||||
}
|
||||
|
||||
type listDashboardResponse {
|
||||
ds_id: String!
|
||||
db_id: String!
|
||||
db_name: String!
|
||||
db_type_id: String!
|
||||
db_type_name: String!
|
||||
db_information: String
|
||||
chaos_event_query_template: String!
|
||||
chaos_verdict_query_template: String!
|
||||
application_metadata_map: [applicationMetadataResponse]
|
||||
cluster_name: String
|
||||
ds_name: String
|
||||
ds_type: String
|
||||
panel_groups: [panelGroupResponse]!
|
||||
end_time: String!
|
||||
start_time: String!
|
||||
refresh_rate: String!
|
||||
project_id: ID!
|
||||
cluster_id: ID!
|
||||
created_at: String
|
||||
updated_at: String
|
||||
ds_id: String!
|
||||
db_id: String!
|
||||
db_name: String!
|
||||
db_type_id: String!
|
||||
db_type_name: String!
|
||||
db_information: String
|
||||
chaos_event_query_template: String!
|
||||
chaos_verdict_query_template: String!
|
||||
application_metadata_map: [applicationMetadataResponse]
|
||||
cluster_name: String
|
||||
ds_name: String
|
||||
ds_type: String
|
||||
panel_groups: [panelGroupResponse]!
|
||||
end_time: String!
|
||||
start_time: String!
|
||||
refresh_rate: String!
|
||||
project_id: ID!
|
||||
cluster_id: ID!
|
||||
created_at: String
|
||||
updated_at: String
|
||||
}
|
||||
|
||||
type applicationMetadataResponse {
|
||||
namespace: String!
|
||||
applications: [resourceResponse]
|
||||
namespace: String!
|
||||
applications: [resourceResponse]
|
||||
}
|
||||
|
||||
type resourceResponse {
|
||||
kind: String!
|
||||
names: [String]
|
||||
kind: String!
|
||||
names: [String]
|
||||
}
|
||||
|
||||
type panelGroupResponse {
|
||||
panels: [panelResponse]
|
||||
panel_group_name: String!
|
||||
panel_group_id: String
|
||||
panels: [panelResponse]
|
||||
panel_group_name: String!
|
||||
panel_group_id: String
|
||||
}
|
||||
|
||||
type panelResponse {
|
||||
panel_id: String!
|
||||
y_axis_left: String
|
||||
y_axis_right: String
|
||||
x_axis_down: String
|
||||
unit: String
|
||||
prom_queries: [promQueryResponse]
|
||||
panel_options: panelOptionResponse
|
||||
panel_name: String
|
||||
created_at: String
|
||||
panel_id: String!
|
||||
y_axis_left: String
|
||||
y_axis_right: String
|
||||
x_axis_down: String
|
||||
unit: String
|
||||
prom_queries: [promQueryResponse]
|
||||
panel_options: panelOptionResponse
|
||||
panel_name: String
|
||||
created_at: String
|
||||
}
|
||||
|
||||
type panelOptionResponse {
|
||||
points: Boolean
|
||||
grids: Boolean
|
||||
left_axis: Boolean
|
||||
points: Boolean
|
||||
grids: Boolean
|
||||
left_axis: Boolean
|
||||
}
|
||||
|
||||
type promQueryResponse {
|
||||
queryid: String!
|
||||
prom_query_name: String
|
||||
legend: String
|
||||
resolution: String
|
||||
minstep: String
|
||||
line: Boolean
|
||||
close_area: Boolean
|
||||
queryid: String!
|
||||
prom_query_name: String
|
||||
legend: String
|
||||
resolution: String
|
||||
minstep: String
|
||||
line: Boolean
|
||||
close_area: Boolean
|
||||
}
|
||||
|
||||
input deleteDSInput {
|
||||
force_delete: Boolean!
|
||||
ds_id: String!
|
||||
}
|
||||
force_delete: Boolean!
|
||||
ds_id: String!
|
||||
}
|
||||
|
||||
enum TimeFrequency {
|
||||
Monthly
|
||||
Weekly
|
||||
Hourly
|
||||
}
|
||||
|
||||
type WorkflowStats {
|
||||
date: Float!
|
||||
value: Int!
|
||||
}
|
||||
|
|
|
@ -345,6 +345,7 @@ type ComplexityRoot struct {
|
|||
GetPromLabelNamesAndValues func(childComplexity int, series *model.PromSeriesInput) int
|
||||
GetPromQuery func(childComplexity int, query *model.PromInput) int
|
||||
GetPromSeriesList func(childComplexity int, dsDetails *model.DsDetails) int
|
||||
GetScheduledWorkflowStats func(childComplexity int, projectID string, filter model.TimeFrequency, showWorkflowRuns bool) int
|
||||
GetTemplateManifestByID func(childComplexity int, templateID string) int
|
||||
GetUser func(childComplexity int, username string) int
|
||||
GetWorkflowRuns func(childComplexity int, workflowRunsInput model.GetWorkflowRunsInput) int
|
||||
|
@ -460,6 +461,11 @@ type ComplexityRoot struct {
|
|||
WorkflowRunID func(childComplexity int) int
|
||||
}
|
||||
|
||||
WorkflowStats struct {
|
||||
Date func(childComplexity int) int
|
||||
Value func(childComplexity int) int
|
||||
}
|
||||
|
||||
AnnotationsPromResponse struct {
|
||||
Legends func(childComplexity int) int
|
||||
Queryid func(childComplexity int) int
|
||||
|
@ -645,6 +651,7 @@ type QueryResolver interface {
|
|||
GetProject(ctx context.Context, projectID string) (*model.Project, error)
|
||||
ListProjects(ctx context.Context) ([]*model.Project, error)
|
||||
Users(ctx context.Context) ([]*model.User, error)
|
||||
GetScheduledWorkflowStats(ctx context.Context, projectID string, filter model.TimeFrequency, showWorkflowRuns bool) ([]*model.WorkflowStats, error)
|
||||
ListWorkflow(ctx context.Context, workflowInput model.ListWorkflowsInput) (*model.ListWorkflowsOutput, error)
|
||||
GetCharts(ctx context.Context, hubName string, projectID string) ([]*model.Chart, error)
|
||||
GetHubExperiment(ctx context.Context, experimentInput model.ExperimentInput) (*model.Chart, error)
|
||||
|
@ -2447,6 +2454,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
|
|||
|
||||
return e.complexity.Query.GetPromSeriesList(childComplexity, args["ds_details"].(*model.DsDetails)), true
|
||||
|
||||
case "Query.getScheduledWorkflowStats":
|
||||
if e.complexity.Query.GetScheduledWorkflowStats == nil {
|
||||
break
|
||||
}
|
||||
|
||||
args, err := ec.field_Query_getScheduledWorkflowStats_args(context.TODO(), rawArgs)
|
||||
if err != nil {
|
||||
return 0, false
|
||||
}
|
||||
|
||||
return e.complexity.Query.GetScheduledWorkflowStats(childComplexity, args["project_id"].(string), args["filter"].(model.TimeFrequency), args["show_workflow_runs"].(bool)), true
|
||||
|
||||
case "Query.GetTemplateManifestByID":
|
||||
if e.complexity.Query.GetTemplateManifestByID == nil {
|
||||
break
|
||||
|
@ -3140,6 +3159,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
|
|||
|
||||
return e.complexity.WorkflowRuns.WorkflowRunID(childComplexity), true
|
||||
|
||||
case "WorkflowStats.date":
|
||||
if e.complexity.WorkflowStats.Date == nil {
|
||||
break
|
||||
}
|
||||
|
||||
return e.complexity.WorkflowStats.Date(childComplexity), true
|
||||
|
||||
case "WorkflowStats.value":
|
||||
if e.complexity.WorkflowStats.Value == nil {
|
||||
break
|
||||
}
|
||||
|
||||
return e.complexity.WorkflowStats.Value(childComplexity), true
|
||||
|
||||
case "annotationsPromResponse.legends":
|
||||
if e.complexity.AnnotationsPromResponse.Legends == nil {
|
||||
break
|
||||
|
@ -3746,265 +3779,277 @@ func (ec *executionContext) introspectType(name string) (*introspection.Type, er
|
|||
}
|
||||
|
||||
var sources = []*ast.Source{
|
||||
{Name: "graph/analytics.graphqls", Input: `input DSInput {
|
||||
ds_id: String
|
||||
ds_name: String!
|
||||
ds_type: String!
|
||||
ds_url: String!
|
||||
access_type: String!
|
||||
auth_type: String!
|
||||
basic_auth_username: String
|
||||
basic_auth_password: String
|
||||
scrape_interval: Int!
|
||||
query_timeout: Int!
|
||||
http_method: String!
|
||||
project_id: String
|
||||
&ast.Source{Name: "graph/analytics.graphqls", Input: `input DSInput {
|
||||
ds_id: String
|
||||
ds_name: String!
|
||||
ds_type: String!
|
||||
ds_url: String!
|
||||
access_type: String!
|
||||
auth_type: String!
|
||||
basic_auth_username: String
|
||||
basic_auth_password: String
|
||||
scrape_interval: Int!
|
||||
query_timeout: Int!
|
||||
http_method: String!
|
||||
project_id: String
|
||||
}
|
||||
|
||||
type DSResponse {
|
||||
ds_id: String
|
||||
ds_name: String
|
||||
ds_type: String
|
||||
ds_url: String
|
||||
access_type: String
|
||||
auth_type: String
|
||||
basic_auth_username: String
|
||||
basic_auth_password: String
|
||||
scrape_interval: Int
|
||||
query_timeout: Int
|
||||
http_method: String
|
||||
project_id: ID!
|
||||
health_status: String!
|
||||
created_at: String
|
||||
updated_at: String
|
||||
ds_id: String
|
||||
ds_name: String
|
||||
ds_type: String
|
||||
ds_url: String
|
||||
access_type: String
|
||||
auth_type: String
|
||||
basic_auth_username: String
|
||||
basic_auth_password: String
|
||||
scrape_interval: Int
|
||||
query_timeout: Int
|
||||
http_method: String
|
||||
project_id: ID!
|
||||
health_status: String!
|
||||
created_at: String
|
||||
updated_at: String
|
||||
}
|
||||
|
||||
input createDBInput {
|
||||
ds_id: String!
|
||||
db_name: String!
|
||||
db_type_name: String!
|
||||
db_type_id: String!
|
||||
db_information: String
|
||||
chaos_event_query_template: String!
|
||||
chaos_verdict_query_template: String!
|
||||
application_metadata_map: [applicationMetadata]
|
||||
panel_groups: [panelGroup]!
|
||||
end_time: String!
|
||||
start_time: String!
|
||||
project_id: ID!
|
||||
cluster_id: ID!
|
||||
refresh_rate: String!
|
||||
ds_id: String!
|
||||
db_name: String!
|
||||
db_type_name: String!
|
||||
db_type_id: String!
|
||||
db_information: String
|
||||
chaos_event_query_template: String!
|
||||
chaos_verdict_query_template: String!
|
||||
application_metadata_map: [applicationMetadata]
|
||||
panel_groups: [panelGroup]!
|
||||
end_time: String!
|
||||
start_time: String!
|
||||
project_id: ID!
|
||||
cluster_id: ID!
|
||||
refresh_rate: String!
|
||||
}
|
||||
|
||||
input applicationMetadata {
|
||||
namespace: String!
|
||||
applications: [resource]
|
||||
namespace: String!
|
||||
applications: [resource]
|
||||
}
|
||||
|
||||
input resource {
|
||||
kind: String!
|
||||
names: [String]
|
||||
kind: String!
|
||||
names: [String]
|
||||
}
|
||||
|
||||
input updateDBInput {
|
||||
db_id: String!
|
||||
ds_id: String!
|
||||
db_name: String!
|
||||
db_type_name: String!
|
||||
db_type_id: String!
|
||||
db_information: String
|
||||
chaos_event_query_template: String!
|
||||
chaos_verdict_query_template: String!
|
||||
application_metadata_map: [applicationMetadata]
|
||||
panel_groups: [updatePanelGroupInput]!
|
||||
end_time: String!
|
||||
start_time: String!
|
||||
cluster_id: ID!
|
||||
refresh_rate: String!
|
||||
db_id: String!
|
||||
ds_id: String!
|
||||
db_name: String!
|
||||
db_type_name: String!
|
||||
db_type_id: String!
|
||||
db_information: String
|
||||
chaos_event_query_template: String!
|
||||
chaos_verdict_query_template: String!
|
||||
application_metadata_map: [applicationMetadata]
|
||||
panel_groups: [updatePanelGroupInput]!
|
||||
end_time: String!
|
||||
start_time: String!
|
||||
cluster_id: ID!
|
||||
refresh_rate: String!
|
||||
}
|
||||
|
||||
input updatePanelGroupInput {
|
||||
panel_group_name: String!
|
||||
panel_group_id: String!
|
||||
panels: [panel]
|
||||
panel_group_name: String!
|
||||
panel_group_id: String!
|
||||
panels: [panel]
|
||||
}
|
||||
|
||||
input panelGroup {
|
||||
panels: [panel]
|
||||
panel_group_name: String!
|
||||
panels: [panel]
|
||||
panel_group_name: String!
|
||||
}
|
||||
|
||||
input panel {
|
||||
panel_id: String
|
||||
db_id: String
|
||||
y_axis_left: String
|
||||
y_axis_right: String
|
||||
x_axis_down: String
|
||||
unit: String
|
||||
panel_group_id: String
|
||||
created_at: String
|
||||
prom_queries: [promQuery]
|
||||
panel_options: panelOption
|
||||
panel_name: String!
|
||||
panel_id: String
|
||||
db_id: String
|
||||
y_axis_left: String
|
||||
y_axis_right: String
|
||||
x_axis_down: String
|
||||
unit: String
|
||||
panel_group_id: String
|
||||
created_at: String
|
||||
prom_queries: [promQuery]
|
||||
panel_options: panelOption
|
||||
panel_name: String!
|
||||
}
|
||||
|
||||
input panelOption {
|
||||
points: Boolean
|
||||
grids: Boolean
|
||||
left_axis: Boolean
|
||||
points: Boolean
|
||||
grids: Boolean
|
||||
left_axis: Boolean
|
||||
}
|
||||
|
||||
input promQuery {
|
||||
queryid: String!
|
||||
prom_query_name: String,
|
||||
legend: String,
|
||||
resolution: String,
|
||||
minstep: String,
|
||||
line: Boolean
|
||||
close_area: Boolean
|
||||
queryid: String!
|
||||
prom_query_name: String
|
||||
legend: String
|
||||
resolution: String
|
||||
minstep: String
|
||||
line: Boolean
|
||||
close_area: Boolean
|
||||
}
|
||||
|
||||
input promInput {
|
||||
queries: [promQueryInput]
|
||||
ds_details: dsDetails!
|
||||
queries: [promQueryInput]
|
||||
ds_details: dsDetails!
|
||||
}
|
||||
|
||||
input promSeriesInput {
|
||||
series: String!
|
||||
ds_details: dsDetails!
|
||||
series: String!
|
||||
ds_details: dsDetails!
|
||||
}
|
||||
|
||||
input dsDetails {
|
||||
url: String!
|
||||
start: String!
|
||||
end: String!
|
||||
url: String!
|
||||
start: String!
|
||||
end: String!
|
||||
}
|
||||
|
||||
input promQueryInput {
|
||||
queryid: String!
|
||||
query: String!
|
||||
legend: String
|
||||
resolution: String
|
||||
minstep: Int!
|
||||
queryid: String!
|
||||
query: String!
|
||||
legend: String
|
||||
resolution: String
|
||||
minstep: Int!
|
||||
}
|
||||
|
||||
type metricsPromResponse {
|
||||
queryid: String!
|
||||
legends: [String]
|
||||
tsvs: [[metricsTimeStampValue]]
|
||||
queryid: String!
|
||||
legends: [String]
|
||||
tsvs: [[metricsTimeStampValue]]
|
||||
}
|
||||
|
||||
type metricsTimeStampValue{
|
||||
date: Float
|
||||
value: Float
|
||||
type metricsTimeStampValue {
|
||||
date: Float
|
||||
value: Float
|
||||
}
|
||||
|
||||
type annotationsPromResponse {
|
||||
queryid: String!
|
||||
legends: [String]
|
||||
tsvs: [[annotationsTimeStampValue]]
|
||||
queryid: String!
|
||||
legends: [String]
|
||||
tsvs: [[annotationsTimeStampValue]]
|
||||
}
|
||||
|
||||
type annotationsTimeStampValue{
|
||||
date: Float
|
||||
value: Int
|
||||
type annotationsTimeStampValue {
|
||||
date: Float
|
||||
value: Int
|
||||
}
|
||||
|
||||
type promResponse {
|
||||
metricsResponse: [metricsPromResponse]
|
||||
annotationsResponse: [annotationsPromResponse]
|
||||
metricsResponse: [metricsPromResponse]
|
||||
annotationsResponse: [annotationsPromResponse]
|
||||
}
|
||||
|
||||
type promSeriesResponse {
|
||||
series: String!
|
||||
labelValues: [labelValue]
|
||||
series: String!
|
||||
labelValues: [labelValue]
|
||||
}
|
||||
|
||||
type promSeriesListResponse {
|
||||
seriesList: [String]
|
||||
seriesList: [String]
|
||||
}
|
||||
|
||||
type labelValue {
|
||||
label: String!
|
||||
values: [option]
|
||||
label: String!
|
||||
values: [option]
|
||||
}
|
||||
|
||||
type option {
|
||||
name: String!
|
||||
name: String!
|
||||
}
|
||||
|
||||
type listDashboardResponse {
|
||||
ds_id: String!
|
||||
db_id: String!
|
||||
db_name: String!
|
||||
db_type_id: String!
|
||||
db_type_name: String!
|
||||
db_information: String
|
||||
chaos_event_query_template: String!
|
||||
chaos_verdict_query_template: String!
|
||||
application_metadata_map: [applicationMetadataResponse]
|
||||
cluster_name: String
|
||||
ds_name: String
|
||||
ds_type: String
|
||||
panel_groups: [panelGroupResponse]!
|
||||
end_time: String!
|
||||
start_time: String!
|
||||
refresh_rate: String!
|
||||
project_id: ID!
|
||||
cluster_id: ID!
|
||||
created_at: String
|
||||
updated_at: String
|
||||
ds_id: String!
|
||||
db_id: String!
|
||||
db_name: String!
|
||||
db_type_id: String!
|
||||
db_type_name: String!
|
||||
db_information: String
|
||||
chaos_event_query_template: String!
|
||||
chaos_verdict_query_template: String!
|
||||
application_metadata_map: [applicationMetadataResponse]
|
||||
cluster_name: String
|
||||
ds_name: String
|
||||
ds_type: String
|
||||
panel_groups: [panelGroupResponse]!
|
||||
end_time: String!
|
||||
start_time: String!
|
||||
refresh_rate: String!
|
||||
project_id: ID!
|
||||
cluster_id: ID!
|
||||
created_at: String
|
||||
updated_at: String
|
||||
}
|
||||
|
||||
type applicationMetadataResponse {
|
||||
namespace: String!
|
||||
applications: [resourceResponse]
|
||||
namespace: String!
|
||||
applications: [resourceResponse]
|
||||
}
|
||||
|
||||
type resourceResponse {
|
||||
kind: String!
|
||||
names: [String]
|
||||
kind: String!
|
||||
names: [String]
|
||||
}
|
||||
|
||||
type panelGroupResponse {
|
||||
panels: [panelResponse]
|
||||
panel_group_name: String!
|
||||
panel_group_id: String
|
||||
panels: [panelResponse]
|
||||
panel_group_name: String!
|
||||
panel_group_id: String
|
||||
}
|
||||
|
||||
type panelResponse {
|
||||
panel_id: String!
|
||||
y_axis_left: String
|
||||
y_axis_right: String
|
||||
x_axis_down: String
|
||||
unit: String
|
||||
prom_queries: [promQueryResponse]
|
||||
panel_options: panelOptionResponse
|
||||
panel_name: String
|
||||
created_at: String
|
||||
panel_id: String!
|
||||
y_axis_left: String
|
||||
y_axis_right: String
|
||||
x_axis_down: String
|
||||
unit: String
|
||||
prom_queries: [promQueryResponse]
|
||||
panel_options: panelOptionResponse
|
||||
panel_name: String
|
||||
created_at: String
|
||||
}
|
||||
|
||||
type panelOptionResponse {
|
||||
points: Boolean
|
||||
grids: Boolean
|
||||
left_axis: Boolean
|
||||
points: Boolean
|
||||
grids: Boolean
|
||||
left_axis: Boolean
|
||||
}
|
||||
|
||||
type promQueryResponse {
|
||||
queryid: String!
|
||||
prom_query_name: String
|
||||
legend: String
|
||||
resolution: String
|
||||
minstep: String
|
||||
line: Boolean
|
||||
close_area: Boolean
|
||||
queryid: String!
|
||||
prom_query_name: String
|
||||
legend: String
|
||||
resolution: String
|
||||
minstep: String
|
||||
line: Boolean
|
||||
close_area: Boolean
|
||||
}
|
||||
|
||||
input deleteDSInput {
|
||||
force_delete: Boolean!
|
||||
ds_id: String!
|
||||
}`, BuiltIn: false},
|
||||
{Name: "graph/image_registry.graphqls", Input: `type imageRegistry {
|
||||
force_delete: Boolean!
|
||||
ds_id: String!
|
||||
}
|
||||
|
||||
enum TimeFrequency {
|
||||
Monthly
|
||||
Weekly
|
||||
Hourly
|
||||
}
|
||||
|
||||
type WorkflowStats {
|
||||
date: Float!
|
||||
value: Int!
|
||||
}
|
||||
`, BuiltIn: false},
|
||||
&ast.Source{Name: "graph/image_registry.graphqls", Input: `type imageRegistry {
|
||||
image_registry_name: String!
|
||||
image_repo_name: String!
|
||||
image_registry_type: String!
|
||||
|
@ -4031,7 +4076,7 @@ type ImageRegistryResponse {
|
|||
is_removed: Boolean
|
||||
}
|
||||
`, BuiltIn: false},
|
||||
{Name: "graph/myhub.graphqls", Input: `enum AuthType {
|
||||
&ast.Source{Name: "graph/myhub.graphqls", Input: `enum AuthType {
|
||||
none
|
||||
basic
|
||||
token
|
||||
|
@ -4205,7 +4250,7 @@ input UpdateMyHub {
|
|||
SSHPublicKey: String
|
||||
}
|
||||
`, BuiltIn: false},
|
||||
{Name: "graph/project.graphqls", Input: `type Project {
|
||||
&ast.Source{Name: "graph/project.graphqls", Input: `type Project {
|
||||
id: ID!
|
||||
name: String!
|
||||
members: [Member!]!
|
||||
|
@ -4237,7 +4282,7 @@ enum MemberRole {
|
|||
Viewer
|
||||
}
|
||||
`, BuiltIn: false},
|
||||
{Name: "graph/schema.graphqls", Input: `# GraphQL schema example
|
||||
&ast.Source{Name: "graph/schema.graphqls", Input: `# GraphQL schema example
|
||||
#
|
||||
# https://gqlgen.com/getting-started/
|
||||
|
||||
|
@ -4507,6 +4552,12 @@ type Query {
|
|||
|
||||
users: [User!]! @authorized
|
||||
|
||||
getScheduledWorkflowStats(
|
||||
project_id: String!
|
||||
filter: TimeFrequency!
|
||||
show_workflow_runs: Boolean!
|
||||
): [WorkflowStats]! @authorized
|
||||
|
||||
ListWorkflow(workflowInput: ListWorkflowsInput!): ListWorkflowsOutput!
|
||||
@authorized
|
||||
|
||||
|
@ -4683,7 +4734,7 @@ type Subscription {
|
|||
@authorized
|
||||
}
|
||||
`, BuiltIn: false},
|
||||
{Name: "graph/usermanagement.graphqls", Input: `type User {
|
||||
&ast.Source{Name: "graph/usermanagement.graphqls", Input: `type User {
|
||||
id: ID!
|
||||
username: String!
|
||||
email: String
|
||||
|
@ -4714,7 +4765,7 @@ input UpdateUserInput {
|
|||
company_name: String
|
||||
}
|
||||
`, BuiltIn: false},
|
||||
{Name: "graph/workflow.graphqls", Input: `enum WorkflowRunStatus {
|
||||
&ast.Source{Name: "graph/workflow.graphqls", Input: `enum WorkflowRunStatus {
|
||||
All
|
||||
Failed
|
||||
Running
|
||||
|
@ -5804,6 +5855,36 @@ func (ec *executionContext) field_Query_getProject_args(ctx context.Context, raw
|
|||
return args, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) field_Query_getScheduledWorkflowStats_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
||||
var err error
|
||||
args := map[string]interface{}{}
|
||||
var arg0 string
|
||||
if tmp, ok := rawArgs["project_id"]; ok {
|
||||
arg0, err = ec.unmarshalNString2string(ctx, tmp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
args["project_id"] = arg0
|
||||
var arg1 model.TimeFrequency
|
||||
if tmp, ok := rawArgs["filter"]; ok {
|
||||
arg1, err = ec.unmarshalNTimeFrequency2githubᚗcomᚋlitmuschaosᚋlitmusᚋlitmusᚑportalᚋgraphqlᚑserverᚋgraphᚋmodelᚐTimeFrequency(ctx, tmp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
args["filter"] = arg1
|
||||
var arg2 bool
|
||||
if tmp, ok := rawArgs["show_workflow_runs"]; ok {
|
||||
arg2, err = ec.unmarshalNBoolean2bool(ctx, tmp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
args["show_workflow_runs"] = arg2
|
||||
return args, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) field_Query_getUser_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
||||
var err error
|
||||
args := map[string]interface{}{}
|
||||
|
@ -14034,6 +14115,67 @@ func (ec *executionContext) _Query_users(ctx context.Context, field graphql.Coll
|
|||
return ec.marshalNUser2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋlitmusᚑportalᚋgraphqlᚑserverᚋgraphᚋmodelᚐUserᚄ(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Query_getScheduledWorkflowStats(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = graphql.Null
|
||||
}
|
||||
}()
|
||||
fc := &graphql.FieldContext{
|
||||
Object: "Query",
|
||||
Field: field,
|
||||
Args: nil,
|
||||
IsMethod: true,
|
||||
}
|
||||
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
rawArgs := field.ArgumentMap(ec.Variables)
|
||||
args, err := ec.field_Query_getScheduledWorkflowStats_args(ctx, rawArgs)
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return graphql.Null
|
||||
}
|
||||
fc.Args = args
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
||||
directive0 := func(rctx context.Context) (interface{}, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return ec.resolvers.Query().GetScheduledWorkflowStats(rctx, args["project_id"].(string), args["filter"].(model.TimeFrequency), args["show_workflow_runs"].(bool))
|
||||
}
|
||||
directive1 := func(ctx context.Context) (interface{}, error) {
|
||||
if ec.directives.Authorized == nil {
|
||||
return nil, errors.New("directive authorized is not implemented")
|
||||
}
|
||||
return ec.directives.Authorized(ctx, nil, directive0)
|
||||
}
|
||||
|
||||
tmp, err := directive1(rctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if tmp == nil {
|
||||
return nil, nil
|
||||
}
|
||||
if data, ok := tmp.([]*model.WorkflowStats); ok {
|
||||
return data, nil
|
||||
}
|
||||
return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/litmuschaos/litmus/litmus-portal/graphql-server/graph/model.WorkflowStats`, tmp)
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return graphql.Null
|
||||
}
|
||||
if resTmp == nil {
|
||||
if !graphql.HasFieldError(ctx, fc) {
|
||||
ec.Errorf(ctx, "must not be null")
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.([]*model.WorkflowStats)
|
||||
fc.Result = res
|
||||
return ec.marshalNWorkflowStats2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋlitmusᚑportalᚋgraphqlᚑserverᚋgraphᚋmodelᚐWorkflowStats(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Query_ListWorkflow(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
|
@ -17852,6 +17994,74 @@ func (ec *executionContext) _WorkflowRuns_last_updated(ctx context.Context, fiel
|
|||
return ec.marshalNString2string(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) _WorkflowStats_date(ctx context.Context, field graphql.CollectedField, obj *model.WorkflowStats) (ret graphql.Marshaler) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = graphql.Null
|
||||
}
|
||||
}()
|
||||
fc := &graphql.FieldContext{
|
||||
Object: "WorkflowStats",
|
||||
Field: field,
|
||||
Args: nil,
|
||||
IsMethod: false,
|
||||
}
|
||||
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return obj.Date, nil
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return graphql.Null
|
||||
}
|
||||
if resTmp == nil {
|
||||
if !graphql.HasFieldError(ctx, fc) {
|
||||
ec.Errorf(ctx, "must not be null")
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.(float64)
|
||||
fc.Result = res
|
||||
return ec.marshalNFloat2float64(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) _WorkflowStats_value(ctx context.Context, field graphql.CollectedField, obj *model.WorkflowStats) (ret graphql.Marshaler) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = graphql.Null
|
||||
}
|
||||
}()
|
||||
fc := &graphql.FieldContext{
|
||||
Object: "WorkflowStats",
|
||||
Field: field,
|
||||
Args: nil,
|
||||
IsMethod: false,
|
||||
}
|
||||
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return obj.Value, nil
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return graphql.Null
|
||||
}
|
||||
if resTmp == nil {
|
||||
if !graphql.HasFieldError(ctx, fc) {
|
||||
ec.Errorf(ctx, "must not be null")
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.(int)
|
||||
fc.Result = res
|
||||
return ec.marshalNInt2int(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
|
@ -24869,6 +25079,20 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr
|
|||
}
|
||||
return res
|
||||
})
|
||||
case "getScheduledWorkflowStats":
|
||||
field := field
|
||||
out.Concurrently(i, func() (res graphql.Marshaler) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
}
|
||||
}()
|
||||
res = ec._Query_getScheduledWorkflowStats(ctx, field)
|
||||
if res == graphql.Null {
|
||||
atomic.AddUint32(&invalids, 1)
|
||||
}
|
||||
return res
|
||||
})
|
||||
case "ListWorkflow":
|
||||
field := field
|
||||
out.Concurrently(i, func() (res graphql.Marshaler) {
|
||||
|
@ -25624,6 +25848,38 @@ func (ec *executionContext) _WorkflowRuns(ctx context.Context, sel ast.Selection
|
|||
return out
|
||||
}
|
||||
|
||||
var workflowStatsImplementors = []string{"WorkflowStats"}
|
||||
|
||||
func (ec *executionContext) _WorkflowStats(ctx context.Context, sel ast.SelectionSet, obj *model.WorkflowStats) graphql.Marshaler {
|
||||
fields := graphql.CollectFields(ec.OperationContext, sel, workflowStatsImplementors)
|
||||
|
||||
out := graphql.NewFieldSet(fields)
|
||||
var invalids uint32
|
||||
for i, field := range fields {
|
||||
switch field.Name {
|
||||
case "__typename":
|
||||
out.Values[i] = graphql.MarshalString("WorkflowStats")
|
||||
case "date":
|
||||
out.Values[i] = ec._WorkflowStats_date(ctx, field, obj)
|
||||
if out.Values[i] == graphql.Null {
|
||||
invalids++
|
||||
}
|
||||
case "value":
|
||||
out.Values[i] = ec._WorkflowStats_value(ctx, field, obj)
|
||||
if out.Values[i] == graphql.Null {
|
||||
invalids++
|
||||
}
|
||||
default:
|
||||
panic("unknown field " + strconv.Quote(field.Name))
|
||||
}
|
||||
}
|
||||
out.Dispatch()
|
||||
if invalids > 0 {
|
||||
return graphql.Null
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
var __DirectiveImplementors = []string{"__Directive"}
|
||||
|
||||
func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler {
|
||||
|
@ -26881,6 +27137,20 @@ func (ec *executionContext) marshalNExperiments2ᚖgithubᚗcomᚋlitmuschaosᚋ
|
|||
return ec._Experiments(ctx, sel, v)
|
||||
}
|
||||
|
||||
func (ec *executionContext) unmarshalNFloat2float64(ctx context.Context, v interface{}) (float64, error) {
|
||||
return graphql.UnmarshalFloat(v)
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalNFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler {
|
||||
res := graphql.MarshalFloat(v)
|
||||
if res == graphql.Null {
|
||||
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
||||
ec.Errorf(ctx, "must not be null")
|
||||
}
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
func (ec *executionContext) unmarshalNGetWorkflowRunsInput2githubᚗcomᚋlitmuschaosᚋlitmusᚋlitmusᚑportalᚋgraphqlᚑserverᚋgraphᚋmodelᚐGetWorkflowRunsInput(ctx context.Context, v interface{}) (model.GetWorkflowRunsInput, error) {
|
||||
return ec.unmarshalInputGetWorkflowRunsInput(ctx, v)
|
||||
}
|
||||
|
@ -27502,6 +27772,15 @@ func (ec *executionContext) marshalNString2ᚕstringᚄ(ctx context.Context, sel
|
|||
return ret
|
||||
}
|
||||
|
||||
func (ec *executionContext) unmarshalNTimeFrequency2githubᚗcomᚋlitmuschaosᚋlitmusᚋlitmusᚑportalᚋgraphqlᚑserverᚋgraphᚋmodelᚐTimeFrequency(ctx context.Context, v interface{}) (model.TimeFrequency, error) {
|
||||
var res model.TimeFrequency
|
||||
return res, res.UnmarshalGQL(v)
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalNTimeFrequency2githubᚗcomᚋlitmuschaosᚋlitmusᚋlitmusᚑportalᚋgraphqlᚑserverᚋgraphᚋmodelᚐTimeFrequency(ctx context.Context, sel ast.SelectionSet, v model.TimeFrequency) graphql.Marshaler {
|
||||
return v
|
||||
}
|
||||
|
||||
func (ec *executionContext) unmarshalNUpdateMyHub2githubᚗcomᚋlitmuschaosᚋlitmusᚋlitmusᚑportalᚋgraphqlᚑserverᚋgraphᚋmodelᚐUpdateMyHub(ctx context.Context, v interface{}) (model.UpdateMyHub, error) {
|
||||
return ec.unmarshalInputUpdateMyHub(ctx, v)
|
||||
}
|
||||
|
@ -27703,6 +27982,43 @@ func (ec *executionContext) marshalNWorkflowSortingField2githubᚗcomᚋlitmusch
|
|||
return v
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalNWorkflowStats2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋlitmusᚑportalᚋgraphqlᚑserverᚋgraphᚋmodelᚐWorkflowStats(ctx context.Context, sel ast.SelectionSet, v []*model.WorkflowStats) graphql.Marshaler {
|
||||
ret := make(graphql.Array, len(v))
|
||||
var wg sync.WaitGroup
|
||||
isLen1 := len(v) == 1
|
||||
if !isLen1 {
|
||||
wg.Add(len(v))
|
||||
}
|
||||
for i := range v {
|
||||
i := i
|
||||
fc := &graphql.FieldContext{
|
||||
Index: &i,
|
||||
Result: &v[i],
|
||||
}
|
||||
ctx := graphql.WithFieldContext(ctx, fc)
|
||||
f := func(i int) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = nil
|
||||
}
|
||||
}()
|
||||
if !isLen1 {
|
||||
defer wg.Done()
|
||||
}
|
||||
ret[i] = ec.marshalOWorkflowStats2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋlitmusᚑportalᚋgraphqlᚑserverᚋgraphᚋmodelᚐWorkflowStats(ctx, sel, v[i])
|
||||
}
|
||||
if isLen1 {
|
||||
f(i)
|
||||
} else {
|
||||
go f(i)
|
||||
}
|
||||
|
||||
}
|
||||
wg.Wait()
|
||||
return ret
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler {
|
||||
return ec.___Directive(ctx, sel, &v)
|
||||
}
|
||||
|
@ -28663,6 +28979,17 @@ func (ec *executionContext) unmarshalOWorkflowSortInput2ᚖgithubᚗcomᚋlitmus
|
|||
return &res, err
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalOWorkflowStats2githubᚗcomᚋlitmuschaosᚋlitmusᚋlitmusᚑportalᚋgraphqlᚑserverᚋgraphᚋmodelᚐWorkflowStats(ctx context.Context, sel ast.SelectionSet, v model.WorkflowStats) graphql.Marshaler {
|
||||
return ec._WorkflowStats(ctx, sel, &v)
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalOWorkflowStats2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋlitmusᚑportalᚋgraphqlᚑserverᚋgraphᚋmodelᚐWorkflowStats(ctx context.Context, sel ast.SelectionSet, v *model.WorkflowStats) graphql.Marshaler {
|
||||
if v == nil {
|
||||
return graphql.Null
|
||||
}
|
||||
return ec._WorkflowStats(ctx, sel, v)
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler {
|
||||
if v == nil {
|
||||
return graphql.Null
|
||||
|
|
|
@ -588,6 +588,11 @@ type WorkflowSortInput struct {
|
|||
Descending *bool `json:"descending"`
|
||||
}
|
||||
|
||||
type WorkflowStats struct {
|
||||
Date float64 `json:"date"`
|
||||
Value int `json:"value"`
|
||||
}
|
||||
|
||||
type AnnotationsPromResponse struct {
|
||||
Queryid string `json:"queryid"`
|
||||
Legends []*string `json:"legends"`
|
||||
|
@ -931,6 +936,49 @@ func (e MemberRole) MarshalGQL(w io.Writer) {
|
|||
fmt.Fprint(w, strconv.Quote(e.String()))
|
||||
}
|
||||
|
||||
type TimeFrequency string
|
||||
|
||||
const (
|
||||
TimeFrequencyMonthly TimeFrequency = "Monthly"
|
||||
TimeFrequencyWeekly TimeFrequency = "Weekly"
|
||||
TimeFrequencyHourly TimeFrequency = "Hourly"
|
||||
)
|
||||
|
||||
var AllTimeFrequency = []TimeFrequency{
|
||||
TimeFrequencyMonthly,
|
||||
TimeFrequencyWeekly,
|
||||
TimeFrequencyHourly,
|
||||
}
|
||||
|
||||
func (e TimeFrequency) IsValid() bool {
|
||||
switch e {
|
||||
case TimeFrequencyMonthly, TimeFrequencyWeekly, TimeFrequencyHourly:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (e TimeFrequency) String() string {
|
||||
return string(e)
|
||||
}
|
||||
|
||||
func (e *TimeFrequency) UnmarshalGQL(v interface{}) error {
|
||||
str, ok := v.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("enums must be strings")
|
||||
}
|
||||
|
||||
*e = TimeFrequency(str)
|
||||
if !e.IsValid() {
|
||||
return fmt.Errorf("%s is not a valid TimeFrequency", str)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e TimeFrequency) MarshalGQL(w io.Writer) {
|
||||
fmt.Fprint(w, strconv.Quote(e.String()))
|
||||
}
|
||||
|
||||
type WorkflowRunSortingField string
|
||||
|
||||
const (
|
||||
|
|
|
@ -268,6 +268,12 @@ type Query {
|
|||
|
||||
users: [User!]! @authorized
|
||||
|
||||
getScheduledWorkflowStats(
|
||||
project_id: String!
|
||||
filter: TimeFrequency!
|
||||
show_workflow_runs: Boolean!
|
||||
): [WorkflowStats]! @authorized
|
||||
|
||||
ListWorkflow(workflowInput: ListWorkflowsInput!): ListWorkflowsOutput!
|
||||
@authorized
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/dgrijalva/jwt-go"
|
||||
jwt "github.com/dgrijalva/jwt-go"
|
||||
"github.com/google/uuid"
|
||||
"github.com/jinzhu/copier"
|
||||
"github.com/litmuschaos/litmus/litmus-portal/graphql-server/graph/generated"
|
||||
|
@ -337,6 +337,10 @@ func (r *queryResolver) Users(ctx context.Context) ([]*model.User, error) {
|
|||
return usermanagement.GetUsers(ctx)
|
||||
}
|
||||
|
||||
func (r *queryResolver) GetScheduledWorkflowStats(ctx context.Context, projectID string, filter model.TimeFrequency, showWorkflowRuns bool) ([]*model.WorkflowStats, error) {
|
||||
return analyticsHandler.GetScheduledWorkflowStats(projectID, filter, showWorkflowRuns)
|
||||
}
|
||||
|
||||
func (r *queryResolver) ListWorkflow(ctx context.Context, workflowInput model.ListWorkflowsInput) (*model.ListWorkflowsOutput, error) {
|
||||
err := validate.ValidateRole(ctx, workflowInput.ProjectID, []model.MemberRole{model.MemberRoleOwner, model.MemberRoleEditor, model.MemberRoleViewer}, usermanagement.AcceptedInvitation)
|
||||
if err != nil {
|
||||
|
|
|
@ -1,24 +1,31 @@
|
|||
package handler
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/jinzhu/copier"
|
||||
"github.com/litmuschaos/litmus/litmus-portal/graphql-server/pkg/analytics"
|
||||
dbOperationsCluster "github.com/litmuschaos/litmus/litmus-portal/graphql-server/pkg/database/mongodb/cluster"
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
|
||||
"github.com/litmuschaos/litmus/litmus-portal/graphql-server/graph/model"
|
||||
"github.com/litmuschaos/litmus/litmus-portal/graphql-server/pkg/analytics/ops"
|
||||
"github.com/litmuschaos/litmus/litmus-portal/graphql-server/pkg/analytics/ops/prometheus"
|
||||
dbOperationsAnalytics "github.com/litmuschaos/litmus/litmus-portal/graphql-server/pkg/database/mongodb/analytics"
|
||||
dbSchemaAnalytics "github.com/litmuschaos/litmus/litmus-portal/graphql-server/pkg/database/mongodb/analytics"
|
||||
dbOperationsCluster "github.com/litmuschaos/litmus/litmus-portal/graphql-server/pkg/database/mongodb/cluster"
|
||||
dbOperationsWorkflow "github.com/litmuschaos/litmus/litmus-portal/graphql-server/pkg/database/mongodb/workflow"
|
||||
dbSchemaWorkflow "github.com/litmuschaos/litmus/litmus-portal/graphql-server/pkg/database/mongodb/workflow"
|
||||
"github.com/litmuschaos/litmus/litmus-portal/graphql-server/utils"
|
||||
)
|
||||
|
||||
|
@ -803,3 +810,159 @@ func QueryListDashboard(projectID string) ([]*model.ListDashboardResponse, error
|
|||
|
||||
return newListDashboard, nil
|
||||
}
|
||||
|
||||
// GetScheduledWorkflowStats returns schedules data for analytics graph
|
||||
func GetScheduledWorkflowStats(projectID string, filter model.TimeFrequency, showWorkflowRuns bool) ([]*model.WorkflowStats, error) {
|
||||
var pipeline mongo.Pipeline
|
||||
dbKey := "created_at"
|
||||
now := time.Now()
|
||||
startTime := strconv.FormatInt(now.Unix(), 10)
|
||||
|
||||
// Match with projectID
|
||||
matchProjectIdStage := bson.D{
|
||||
{"$match", bson.D{
|
||||
{"project_id", projectID},
|
||||
}},
|
||||
}
|
||||
pipeline = append(pipeline, matchProjectIdStage)
|
||||
|
||||
// Unwind the workflow runs if workflow run stats are requested
|
||||
if showWorkflowRuns {
|
||||
// Flatten out the workflow runs
|
||||
unwindStage := bson.D{
|
||||
{"$unwind", bson.D{
|
||||
{"path", "$workflow_runs"},
|
||||
}},
|
||||
}
|
||||
pipeline = append(pipeline, unwindStage)
|
||||
dbKey = "workflow_runs.last_updated"
|
||||
}
|
||||
|
||||
// Query the database according to filter type
|
||||
switch filter {
|
||||
case model.TimeFrequencyMonthly:
|
||||
// Subtracting 6 months from the start time
|
||||
sixMonthsAgo := now.AddDate(0, -6, 0)
|
||||
// To fetch data only for last 6 months
|
||||
filterMonthlyStage := bson.D{
|
||||
{"$match", bson.D{
|
||||
{dbKey, bson.D{
|
||||
{"$gte", strconv.FormatInt(sixMonthsAgo.Unix(), 10)},
|
||||
{"$lte", startTime},
|
||||
}},
|
||||
}},
|
||||
}
|
||||
pipeline = append(pipeline, filterMonthlyStage)
|
||||
case model.TimeFrequencyWeekly:
|
||||
// Subtracting 28days(4weeks) from the start time
|
||||
fourWeeksAgo := now.AddDate(0, 0, -28)
|
||||
// To fetch data only for last 4weeks
|
||||
filterWeeklyStage := bson.D{
|
||||
{"$match", bson.D{
|
||||
{dbKey, bson.D{
|
||||
{"$gte", strconv.FormatInt(fourWeeksAgo.Unix(), 10)},
|
||||
{"$lte", startTime},
|
||||
}},
|
||||
}},
|
||||
}
|
||||
pipeline = append(pipeline, filterWeeklyStage)
|
||||
case model.TimeFrequencyHourly:
|
||||
// Subtracting 48hrs from the start time
|
||||
fortyEightHoursAgo := now.Add(time.Hour * -48)
|
||||
// To fetch data only for last 48hrs
|
||||
filterHourlyStage := bson.D{
|
||||
{"$match", bson.D{
|
||||
{dbKey, bson.D{
|
||||
{"$gte", strconv.FormatInt(fortyEightHoursAgo.Unix(), 10)},
|
||||
{"$lte", startTime},
|
||||
}},
|
||||
}},
|
||||
}
|
||||
pipeline = append(pipeline, filterHourlyStage)
|
||||
default:
|
||||
// Returns error if no matching filter found
|
||||
return nil, errors.New("no matching filter found")
|
||||
}
|
||||
|
||||
// Call aggregation on pipeline
|
||||
workflowsCursor, err := dbOperationsWorkflow.GetAggregateWorkflows(pipeline)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Result array
|
||||
var result []*model.WorkflowStats
|
||||
|
||||
// Map to store schedule count monthly(last 6months), weekly(last 4weeks) and hourly (last 48hrs)
|
||||
statsMap := make(map[string]model.WorkflowStats)
|
||||
|
||||
// Initialize the value of the map based on filter
|
||||
switch filter {
|
||||
case model.TimeFrequencyMonthly:
|
||||
for monthsAgo := now.AddDate(0, -5, 0); monthsAgo.Before(now) || monthsAgo.Equal(now); monthsAgo = monthsAgo.AddDate(0, 1, 0) {
|
||||
// Storing the timestamp of first day of the monthsAgo
|
||||
date := float64(time.Date(monthsAgo.Year(), monthsAgo.Month(), 1, 0, 0, 0, 0, time.Local).Unix())
|
||||
statsMap[string(int(monthsAgo.Month())%12)] = model.WorkflowStats{
|
||||
Date: date * 1000,
|
||||
Value: 0,
|
||||
}
|
||||
}
|
||||
case model.TimeFrequencyWeekly:
|
||||
year, endWeek := now.ISOWeek()
|
||||
for week := endWeek - 3; week <= endWeek; week++ {
|
||||
// Storing the timestamp of first day of the ISO week
|
||||
date := float64(ops.FirstDayOfISOWeek(year, week, time.Local).Unix())
|
||||
statsMap[string(week%53)] = model.WorkflowStats{
|
||||
Date: date * 1000,
|
||||
Value: 0,
|
||||
}
|
||||
}
|
||||
case model.TimeFrequencyHourly:
|
||||
for hoursAgo := now.Add(time.Hour * -48); hoursAgo.Before(now) || hoursAgo.Equal(now); hoursAgo = hoursAgo.Add(time.Hour * 1) {
|
||||
// Storing the timestamp of first day of the hoursAgo
|
||||
date := float64(time.Date(hoursAgo.Year(), hoursAgo.Month(), hoursAgo.Day(), hoursAgo.Hour(), 0, 0, 0, time.Local).Unix())
|
||||
statsMap[fmt.Sprintf("%d-%d", hoursAgo.Day(), hoursAgo.Hour())] = model.WorkflowStats{
|
||||
Date: date * 1000,
|
||||
Value: 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if showWorkflowRuns {
|
||||
var workflows []dbSchemaWorkflow.FlattenedWorkflowRun
|
||||
if err = workflowsCursor.All(context.Background(), &workflows); err != nil || len(workflows) == 0 {
|
||||
fmt.Println(err)
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// Iterate through the workflows and find the frequency of workflow runs according to filter
|
||||
for _, workflow := range workflows {
|
||||
if err = ops.CreateDateMap(workflow.WorkflowRuns.LastUpdated, filter, statsMap); err != nil {
|
||||
return result, err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var workflows []dbSchemaWorkflow.ChaosWorkFlowInput
|
||||
if err = workflowsCursor.All(context.Background(), &workflows); err != nil || len(workflows) == 0 {
|
||||
fmt.Println(err)
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// Iterate through the workflows and find the frequency of workflows according to filter
|
||||
for _, workflow := range workflows {
|
||||
if err = ops.CreateDateMap(workflow.UpdatedAt, filter, statsMap); err != nil {
|
||||
return result, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// To fill the result array from statsMap for monthly and weekly data
|
||||
for _, val := range statsMap {
|
||||
result = append(result, &model.WorkflowStats{Date: val.Date, Value: val.Value})
|
||||
}
|
||||
|
||||
// Sorts the result array in ascending order of time
|
||||
sort.SliceStable(result, func(i, j int) bool { return result[i].Date < result[j].Date })
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
|
|
@ -0,0 +1,70 @@
|
|||
package ops
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/litmuschaos/litmus/litmus-portal/graphql-server/graph/model"
|
||||
)
|
||||
|
||||
// FirstDayOfISOWeek returns first day of the given ISO week
|
||||
func FirstDayOfISOWeek(year int, week int, timezone *time.Location) time.Time {
|
||||
date := time.Date(year, 0, 0, 0, 0, 0, 0, timezone)
|
||||
isoYear, isoWeek := date.ISOWeek()
|
||||
for date.Weekday() != time.Monday { // iterate back to Monday
|
||||
date = date.AddDate(0, 0, -1)
|
||||
isoYear, isoWeek = date.ISOWeek()
|
||||
}
|
||||
for isoYear < year { // iterate forward to the first day of the first week
|
||||
date = date.AddDate(0, 0, 1)
|
||||
isoYear, isoWeek = date.ISOWeek()
|
||||
}
|
||||
for isoWeek < week { // iterate forward to the first day of the given week
|
||||
date = date.AddDate(0, 0, 1)
|
||||
isoYear, isoWeek = date.ISOWeek()
|
||||
}
|
||||
return date
|
||||
}
|
||||
|
||||
func CreateDateMap(updatedAt string, filter model.TimeFrequency, statsMap map[string]model.WorkflowStats) error {
|
||||
// Converts the time stamp(string) to unix
|
||||
i, err := strconv.ParseInt(updatedAt, 10, 64)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Converts unix time to time.Time
|
||||
lastUpdatedTime := time.Unix(i, 0)
|
||||
|
||||
// Switch case to fill the map according to filter
|
||||
switch filter {
|
||||
case model.TimeFrequencyMonthly:
|
||||
key := int(lastUpdatedTime.Month())
|
||||
month := statsMap[string(key)]
|
||||
|
||||
// Incrementing the value for each month
|
||||
month.Value++
|
||||
statsMap[string(key)] = month
|
||||
|
||||
case model.TimeFrequencyWeekly:
|
||||
_, key := lastUpdatedTime.ISOWeek()
|
||||
week := statsMap[string(key)]
|
||||
|
||||
// Incrementing the value for each ISO week
|
||||
week.Value++
|
||||
statsMap[string(key)] = week
|
||||
|
||||
case model.TimeFrequencyHourly:
|
||||
key := fmt.Sprintf("%d-%d", lastUpdatedTime.Day(), lastUpdatedTime.Hour())
|
||||
hour := statsMap[key]
|
||||
|
||||
// Incrementing the value for each hour
|
||||
hour.Value++
|
||||
statsMap[key] = hour
|
||||
|
||||
default:
|
||||
return errors.New("no matching filter found")
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -352,6 +352,9 @@ func QueryWorkflowRuns(input model.GetWorkflowRunsInput) (*model.GetWorkflowsOut
|
|||
|
||||
// Call aggregation on pipeline
|
||||
workflowsCursor, err := dbOperationsWorkflow.GetAggregateWorkflows(pipeline)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var result []*model.WorkflowRun
|
||||
|
||||
|
@ -516,7 +519,6 @@ func QueryListWorkflow(workflowInput model.ListWorkflowsInput) (*model.ListWorkf
|
|||
|
||||
// Call aggregation on pipeline
|
||||
workflowsCursor, err := dbOperationsWorkflow.GetAggregateWorkflows(pipeline)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -80,3 +80,14 @@ const (
|
|||
//ExitedProject is the state when the user has exited the project
|
||||
ExitedProject Invitation = "Exited"
|
||||
)
|
||||
|
||||
// Filter: different types of filter for graphs
|
||||
type Filter string
|
||||
|
||||
const (
|
||||
Monthly Filter = "Monthly"
|
||||
|
||||
Weekly Filter = "Weekly"
|
||||
|
||||
Hourly Filter = "Hourly"
|
||||
)
|
||||
|
|
|
@ -208,7 +208,7 @@ func (c GitConfig) getAuthMethod() (transport.AuthMethod, error) {
|
|||
return nil, nil
|
||||
|
||||
default:
|
||||
return nil, errors.New("No Mathcing Auth Type Found")
|
||||
return nil, errors.New("No Matching Auth Type Found")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue