Skip to content

Commit

Permalink
feat: promql 降采样原始默认改为false
Browse files Browse the repository at this point in the history
  • Loading branch information
liangling0628 committed Nov 26, 2024
1 parent 6c3e20e commit f256c28
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/profiling/src/datasource/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ export default class DashboardDatasource extends DataSourceApi<ProfilingQuery, Q
this.request<BackendDataSourceResponse>(QueryUrl.query_graph_profile, {
data: {
bk_biz_id: this.bizId,
start: options.range.from.unix(),
end: options.range.to.unix(),
start: options.range.from.valueOf() * 1000,
end: options.range.to.valueOf() * 1000,
app_name: target.app_name,
service_name: target.service_name,
data_type: target.profile_type,
Expand Down
2 changes: 1 addition & 1 deletion src/timeseries/src/components/editor-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { LanguageContext } from '../utils/context';
export interface IEditorFormProps {
labelStyle?: React.CSSProperties;
metricList?: MetricDetail[];
renderTitle?: () => Element;
renderTitle?: () => React.ReactNode;
style?: React.CSSProperties;
tips?: string;
title?: string;
Expand Down
12 changes: 8 additions & 4 deletions src/timeseries/src/components/query-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import {
} from '../typings/metric';
import { handleTransformOldQuery } from '../utils/common';
import { LanguageContext } from '../utils/context';
import { getCookie, t } from 'common/utils/utils';
import { language, t } from 'common/utils/utils';
import AddvanceSetting, { type AddvanceSettingKey } from './addvance-setting';
import AliasInput from './alias-input';
import ConditionInput from './condition-input';
Expand Down Expand Up @@ -118,7 +118,6 @@ export default class MonitorQueryEditor extends React.PureComponent<IQueryEditor
promqlAlias = '',
source = '',
step = '',
enableDownSampling = true,
} = query;
let expressions: IExpresionItem[] = expressionList;
// 兼容旧版本
Expand All @@ -132,6 +131,11 @@ export default class MonitorQueryEditor extends React.PureComponent<IQueryEditor
},
];
}
const stateMode = only_promql || mode === 'code' ? 'code' : 'ui';
let enableDownSampling = query.enableDownSampling;
if (enableDownSampling === undefined) {
enableDownSampling = stateMode !== 'code';
}
this.state = {
cluster,
editorStatus: 'default',
Expand All @@ -141,10 +145,10 @@ export default class MonitorQueryEditor extends React.PureComponent<IQueryEditor
host,
inited: false,
isTranform: false,
language: getCookie('blueking_language'),
language: language,
loading: true,
metricList: [{} as any],
mode: only_promql || mode === 'code' ? 'code' : 'ui',
mode: stateMode,
module,
promqlAlias: promqlAlias || alias,
searchState: SearcState.deafult,
Expand Down

0 comments on commit f256c28

Please sign in to comment.