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AAS,OAAD,UAAMC,EAAN,CAAa8F,OAAQoE,EAAKnJ,KAAKoE,GAAMA,EAAEtF,YAEjDa,MAAO,GACPjB,YAAY,MACZI,MAAOG,EAAM8F,YAGjB,SAAC,EAAAvF,YAAD,CAAahB,MAAM,SAAS2B,MAAI,EAAhC,UACE,SAAC,EAAA8I,YAAD,CACEpJ,QAASuJ,EACTpK,SAAWmK,IACTnK,EAAS,OAAD,UAAMC,EAAN,CAAaoK,OAAQF,EAAKnJ,KAAKoE,GAAMA,EAAEtF,YAEjDJ,YAAY,MACZI,MAAOG,EAAMoK,iBAQlB,MAAMR,EAAgB,CAC3B,iBACA,mBACA,2BACA,aACA,mBACA7I,KAAK0B,IAAD,CAAUlD,MAAOkD,EAAG5C,MAAO4C,MAEpBwH,EAAa,CACxB,MACA,MACA,OACAlJ,KAAK0B,IAAD,CAAUlD,MAAOkD,EAAG5C,MAAO4C,MAEpB0H,EAAa,CACxB,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,MACApJ,KAAK0B,IAAD,CAAUlD,MAAOkD,EAAG5C,MAAO4C,M,qCC/HjC,IAAIe,EAAQ,EAyBL,SAAS6G,IAEd,OADA7G,GAASA,EAAQ8G,KAAKC,MAAsB,EAAhBD,KAAKE,WAAiBC,EAAMzF,OACjDyF,EAAMjH,GAWf,MAAMiH,EAAQ,CACZ,KACA,OACA,MACA,KACA,YACA,KACA,QACA,OACA,cACA,UACA,MACA,aACA,cACA,aACA,WACA,QACA,WACA,OACA,UACA,KACA,OACA,YACA,YACA,OACA,YACA,aACA,MACA,YACA,YACA,OACA,KACA,QACA,MACA,UACA,WACA,WACA,QACA,KACA,MACA,UACA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EAAA5C,YAAD,CAAaW,MAAI,EAAjB,UACE,SAAC,EAAAsI,SAAD,CACErJ,KAAK,cACLN,MAAOG,EAAMmS,YACb1I,KAAM,GACNhK,YAAY,0CACZM,SAAUE,MAKA,sBAAfkD,IACC,SAAC4C,EAAD,CAAwBhG,SAAU8Y,EAAmB7Y,MAAOA,EAAO0H,GAAIuQ,IAEzD,yBAAf9U,IAAyC,SAACwB,EAAD,CAAgB5E,SA1IrCqS,IACvBmG,EAAS,OAAD,UAAMvY,EAAN,CAAaoS,QAAAA,MAyIkExN,MAAO5E,EAAMoS,UAClF,eAAfjP,IACC,SAACqC,EAAD,CAAiBzF,SAAW2Z,GAAoB3Z,EAAS,OAAD,UAAMC,EAAN,CAAayF,MAAOiU,KAAQ1Z,MAAOA,IAE7E,qBAAfmD,IAAqC,SAACwW,EAAD,CAAa5Z,SAAUwY,EAAUvY,MAAOA,EAAO0H,GAAIuQ,IAExF5S,IAAe,uBAAIA,UOjSvBuU,uBAAuBhC,IACvBiC,cAAc,CACbtS,MAAO,QACPhD,KAAM,UACNoK,KAAMM,GACNzP,GAAI","sources":["webpack://grafana/./public/app/plugins/datasource/testdata/ConfigEditor.tsx","webpack://grafana/./public/app/plugins/datasource/testdata/components/StreamingClientEditor.tsx","webpack://grafana/./public/app/plugins/datasource/testdata/components/RandomWalkEditor.tsx","webpack://grafana/./public/app/plugins/datasource/testdata/components/CSVContentEditor.tsx","webpack://grafana/./public/app/plugins/datasource/testdata/components/CSVFileEditor.tsx","webpack://grafana/./public/app/plugins/datasource/testdata/constants.ts","webpack://grafana/./public/app/plugins/datasource/testdata/components/CSVWaveEditor.tsx","webpack://grafana/./public/app/plugins/datasource/testdata/components/ErrorEditor.tsx","webpack://grafana/./public/app/plugins/datasource/testdata/components/GrafanaLiveEditor.tsx","webpack://grafana/./public/app/plugins/datasource/testdata/components/NodeGraphEditor.tsx","webpack://grafana/./public/app/plugins/datasource/testdata/components/PredictablePulseEditor.tsx","webpack://grafana/./public/app/plugins/datasource/testdata/components/RawFrameEditor.tsx","webpack://grafana/./public/app/plugins/datasource/testdata/components/SimulationQueryEditor.tsx","webpack://grafana/./public/app/plugins/datasource/testdata/components/USAQueryEditor.tsx","webpack://grafana/./public/app/plugins/datasource/testdata/LogIpsum.ts","webpack://grafana/./public/app/plugins/datasource/testdata/runStreams.ts","webpack://grafana/./public/app/plugins/datasource/testdata/QueryEditor.tsx","webpack://grafana/./public/app/plugins/datasource/testdata/TestInfoTab.tsx","webpack://grafana/./public/app/plugins/datasource/testdata/metricTree.ts","webpack://grafana/./public/app/plugins/datasource/testdata/testData/serviceMapResponse.ts","webpack://grafana/./public/app/plugins/datasource/testdata/nodeGraphUtils.ts","webpack://grafana/./public/app/plugins/datasource/testdata/variables.ts","webpack://grafana/./public/app/plugins/datasource/testdata/datasource.ts","webpack://grafana/./public/app/plugins/datasource/testdata/module.tsx"],"sourcesContent":["// Libraries\nimport React, { PureComponent } from 'react';\n\nimport { DataSourcePluginOptionsEditorProps } from '@grafana/data';\n\ntype Props = DataSourcePluginOptionsEditorProps<any>;\n\n/**\n * Empty Config Editor -- settings to save\n */\nexport class ConfigEditor extends PureComponent<Props> {\n render() {\n return <div />;\n }\n}\n","import React, { ChangeEvent } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { InlineField, InlineFieldRow, Input, Select } from '@grafana/ui';\n\nimport { EditorProps } from '../QueryEditor';\nimport { StreamingQuery } from '../types';\n\nconst streamingClientFields = [\n { label: 'Speed (ms)', id: 'speed', placeholder: 'value', min: 10, step: 10 },\n { label: 'Spread', id: 'spread', placeholder: 'value', min: 0.5, step: 0.1 },\n { label: 'Noise', id: 'noise', placeholder: 'value', min: 0, step: 0.1 },\n { label: 'Bands', id: 'bands', placeholder: 'bands', min: 0, step: 1 },\n];\n\nconst types = [\n { value: 'signal', label: 'Signal' },\n { value: 'logs', label: 'Logs' },\n { value: 'fetch', label: 'Fetch' },\n];\n\nexport const StreamingClientEditor = ({ onChange, query }: EditorProps) => {\n const onSelectChange = ({ value }: SelectableValue) => {\n onChange({ target: { name: 'type', value } });\n };\n\n // Convert values to numbers before saving\n const onInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n const { name, value } = e.target;\n onChange({ target: { name, value: Number(value) } });\n };\n\n return (\n <InlineFieldRow>\n <InlineField label=\"Type\" labelWidth={14}>\n <Select width={32} onChange={onSelectChange} defaultValue={types[0]} options={types} />\n </InlineField>\n {query?.stream?.type === 'signal' &&\n streamingClientFields.map(({ label, id, min, step, placeholder }) => {\n return (\n <InlineField label={label} labelWidth={14} key={id}>\n <Input\n width={32}\n type=\"number\"\n id={`stream.${id}-${query.refId}`}\n name={id}\n min={min}\n step={step}\n value={query.stream?.[id as keyof StreamingQuery]}\n placeholder={placeholder}\n onChange={onInputChange}\n />\n </InlineField>\n );\n })}\n\n {query?.stream?.type === 'fetch' && (\n <InlineField label=\"URL\" labelWidth={14} grow>\n <Input\n type=\"text\"\n name=\"url\"\n id={`stream.url-${query.refId}`}\n value={query?.stream?.url}\n placeholder=\"Fetch URL\"\n onChange={onChange}\n />\n </InlineField>\n )}\n </InlineFieldRow>\n );\n};\n","import React from 'react';\n\nimport { selectors } from '@grafana/e2e-selectors';\nimport { InlineField, InlineFieldRow, Input } from '@grafana/ui';\n\nimport { EditorProps } from '../QueryEditor';\nimport { TestDataQuery } from '../types';\n\nconst randomWalkFields = [\n { label: 'Series count', id: 'seriesCount', placeholder: '1', min: 1, step: 1 },\n { label: 'Start value', id: 'startValue', placeholder: 'auto', step: 1 },\n { label: 'Min', id: 'min', placeholder: 'none', step: 0.1 },\n { label: 'Max', id: 'max', placeholder: 'none', step: 0.1 },\n { label: 'Spread', id: 'spread', placeholder: '1', min: 0.5, step: 0.1 },\n { label: 'Noise', id: 'noise', placeholder: '0', min: 0, step: 0.1 },\n {\n label: 'Drop (%)',\n id: 'drop',\n placeholder: '0',\n min: 0,\n max: 100,\n step: 1,\n tooltip: 'Exclude some percent (chance) points',\n },\n];\n\nconst testSelectors = selectors.components.DataSource.TestData.QueryTab;\ntype Selector = 'max' | 'min' | 'noise' | 'seriesCount' | 'spread' | 'startValue' | 'drop';\n\nexport const RandomWalkEditor = ({ onChange, query }: EditorProps) => {\n return (\n <InlineFieldRow>\n {randomWalkFields.map(({ label, id, min, step, placeholder, tooltip }) => {\n const selector = testSelectors?.[id as Selector];\n return (\n <InlineField label={label} labelWidth={14} key={id} aria-label={selector} tooltip={tooltip}>\n <Input\n width={32}\n name={id}\n type=\"number\"\n id={`randomWalk-${id}-${query.refId}`}\n min={min}\n step={step}\n value={(query as any)[id as keyof TestDataQuery] || placeholder}\n placeholder={placeholder}\n onChange={onChange}\n />\n </InlineField>\n );\n })}\n </InlineFieldRow>\n );\n};\n","import React from 'react';\n\nimport { CodeEditor } from '@grafana/ui';\n\nimport { EditorProps } from '../QueryEditor';\n\nexport const CSVContentEditor = ({ onChange, query }: EditorProps) => {\n const onSaveCSV = (csvContent: string) => {\n onChange({ ...query, csvContent });\n };\n\n return (\n <CodeEditor\n height={300}\n language=\"csv\"\n value={query.csvContent ?? ''}\n onBlur={onSaveCSV}\n onSave={onSaveCSV}\n showMiniMap={false}\n showLineNumbers={true}\n />\n );\n};\n","import React from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { InlineField, InlineFieldRow, Select } from '@grafana/ui';\n\nimport { EditorProps } from '../QueryEditor';\n\nexport const CSVFileEditor = ({ onChange, query }: EditorProps) => {\n const onChangeFileName = ({ value }: SelectableValue<string>) => {\n onChange({ ...query, csvFileName: value });\n };\n\n const files = [\n 'flight_info_by_state.csv',\n 'population_by_state.csv',\n 'gdp_per_capita.csv',\n 'js_libraries.csv',\n 'ohlc_dogecoin.csv',\n 'weight_height.csv',\n 'browser_marketshare.csv',\n ].map((name) => ({ label: name, value: name }));\n\n return (\n <InlineFieldRow>\n <InlineField label=\"File\" labelWidth={14}>\n <Select\n width={32}\n onChange={onChangeFileName}\n placeholder=\"Select csv file\"\n options={files}\n value={files.find((f) => f.value === query.csvFileName)}\n />\n </InlineField>\n </InlineFieldRow>\n );\n};\n","import { CSVWave, TestDataQuery } from './types';\n\nexport const defaultPulseQuery: any = {\n timeStep: 60,\n onCount: 3,\n onValue: 2,\n offCount: 3,\n offValue: 1,\n};\n\nexport const defaultCSVWaveQuery: CSVWave[] = [\n {\n timeStep: 60,\n valuesCSV: '0,0,2,2,1,1',\n },\n];\n\nexport const defaultQuery: TestDataQuery = {\n scenarioId: 'random_walk',\n refId: '',\n};\n","import React, { PureComponent, useState } from 'react';\n\nimport { Button, InlineField, InlineFieldRow, Input } from '@grafana/ui';\n\nimport { defaultCSVWaveQuery } from '../constants';\nimport type { CSVWave } from '../types';\n\ninterface WavesProps {\n waves?: CSVWave[];\n onChange: (waves: CSVWave[]) => void;\n}\n\ninterface WaveProps {\n wave: CSVWave;\n index: number;\n last: boolean;\n onChange: (index: number, wave?: CSVWave) => void;\n onAdd: () => void;\n}\n\nconst CSVWaveEditor = (props: WaveProps) => {\n const { wave, last, index, onAdd, onChange } = props;\n const [valuesCSV, setValuesCSV] = useState(wave.valuesCSV || '');\n const [labels, setLabels] = useState(wave.labels || '');\n const [name, setName] = useState(wave.name || '');\n const onAction = () => {\n if (last) {\n onAdd();\n } else {\n onChange(index, undefined);\n }\n };\n const onValueChange = <K extends keyof CSVWave, V extends CSVWave[K]>(key: K, value: V) => {\n onChange(index, { ...wave, [key]: value });\n };\n const onKeyDown = (evt: React.KeyboardEvent<HTMLInputElement>) => {\n if (evt.key === 'Enter') {\n onValueChange('valuesCSV', valuesCSV);\n }\n };\n\n return (\n <InlineFieldRow>\n <InlineField\n label={'Values'}\n grow\n tooltip=\"Comma separated values. Each value may be an int, float, or null and must not be empty. Whitespace and trailing commas are removed\"\n >\n <Input\n value={valuesCSV}\n placeholder={'CSV values'}\n onChange={(e) => setValuesCSV(e.currentTarget.value)}\n autoFocus={true}\n onBlur={() => onValueChange('valuesCSV', valuesCSV)}\n onKeyDown={onKeyDown}\n />\n </InlineField>\n <InlineField label={'Step'} tooltip=\"The number of seconds between datapoints.\">\n <Input\n value={wave.timeStep}\n type=\"number\"\n placeholder={'60'}\n width={10}\n onChange={(e) => onValueChange('timeStep', e.currentTarget.valueAsNumber)}\n />\n </InlineField>\n <InlineField label={'Name'}>\n <Input\n value={name}\n placeholder={'name'}\n width={10}\n onChange={(e) => setName(e.currentTarget.value)}\n onBlur={() => onValueChange('name', name)}\n />\n </InlineField>\n <InlineField label={'Labels'}>\n <Input\n value={labels}\n placeholder={'labels'}\n width={12}\n onChange={(e) => setLabels(e.currentTarget.value)}\n onBlur={() => onValueChange('labels', labels)}\n />\n </InlineField>\n <Button icon={last ? 'plus' : 'minus'} variant=\"secondary\" onClick={onAction} />\n </InlineFieldRow>\n );\n};\n\nexport class CSVWavesEditor extends PureComponent<WavesProps> {\n onChange = (index: number, wave?: CSVWave) => {\n let waves = [...(this.props.waves ?? defaultCSVWaveQuery)];\n if (wave) {\n waves[index] = { ...wave };\n } else {\n // remove the element\n waves.splice(index, 1);\n }\n this.props.onChange(waves);\n };\n\n onAdd = () => {\n const waves = [...(this.props.waves ?? defaultCSVWaveQuery)];\n waves.push({ ...defaultCSVWaveQuery[0] });\n this.props.onChange(waves);\n };\n\n render() {\n let waves = this.props.waves ?? defaultCSVWaveQuery;\n if (!waves.length) {\n waves = defaultCSVWaveQuery;\n }\n\n return (\n <>\n {waves.map((wave, index) => (\n <CSVWaveEditor\n key={`${index}/${wave.valuesCSV}`}\n wave={wave}\n index={index}\n onAdd={this.onAdd}\n onChange={this.onChange}\n last={index === waves.length - 1}\n />\n ))}\n </>\n );\n }\n}\n","import React from 'react';\n\nimport { InlineField, InlineFieldRow, Select } from '@grafana/ui';\n\nimport { EditorProps } from '../QueryEditor';\n\nconst ERROR_OPTIONS = [\n {\n label: 'Server panic',\n value: 'server_panic',\n },\n {\n label: 'Frontend exception',\n value: 'frontend_exception',\n },\n {\n label: 'Frontend observable',\n value: 'frontend_observable',\n },\n];\n\nconst FrontendErrorQueryEditor: React.FC<EditorProps> = ({ query, onChange }) => {\n return (\n <InlineFieldRow>\n <InlineField labelWidth={14} label=\"Error type\">\n <Select\n options={ERROR_OPTIONS}\n value={query.errorType}\n onChange={(v) => {\n onChange({ ...query, errorType: v.value });\n }}\n />\n </InlineField>\n </InlineFieldRow>\n );\n};\n\nexport default FrontendErrorQueryEditor;\n","import React from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { InlineField, InlineFieldRow, Select } from '@grafana/ui';\n\nimport { EditorProps } from '../QueryEditor';\n\nconst liveTestDataChannels = [\n {\n label: 'random-2s-stream',\n value: 'random-2s-stream',\n description: 'Random stream with points every 2s',\n },\n {\n label: 'random-flakey-stream',\n value: 'random-flakey-stream',\n description: 'Stream that returns data in random intervals',\n },\n {\n label: 'random-labeled-stream',\n value: 'random-labeled-stream',\n description: 'Value with moving labels',\n },\n {\n label: 'random-20Hz-stream',\n value: 'random-20Hz-stream',\n description: 'Random stream with points in 20Hz',\n },\n];\n\nexport const GrafanaLiveEditor = ({ onChange, query }: EditorProps) => {\n const onChannelChange = ({ value }: SelectableValue<string>) => {\n onChange({ ...query, channel: value });\n };\n\n return (\n <InlineFieldRow>\n <InlineField label=\"Channel\" labelWidth={14}>\n <Select\n width={32}\n onChange={onChannelChange}\n placeholder=\"Select channel\"\n options={liveTestDataChannels}\n value={liveTestDataChannels.find((f) => f.value === query.channel)}\n />\n </InlineField>\n </InlineFieldRow>\n );\n};\n","import React from 'react';\n\nimport { Input, InlineFieldRow, InlineField, Select } from '@grafana/ui';\n\nimport { NodesQuery, TestDataQuery } from '../types';\n\nexport interface Props {\n onChange: (value: NodesQuery) => void;\n query: TestDataQuery;\n}\nexport function NodeGraphEditor({ query, onChange }: Props) {\n const type = query.nodes?.type || 'random';\n return (\n <InlineFieldRow>\n <InlineField label=\"Data type\" labelWidth={14}>\n <Select<NodesQuery['type']>\n options={options.map((o) => ({\n label: o,\n value: o,\n }))}\n value={options.find((item) => item === type)}\n onChange={(value) => onChange({ ...query.nodes, type: value.value! })}\n width={32}\n />\n </InlineField>\n {type === 'random' && (\n <InlineField label=\"Count\" labelWidth={14}>\n <Input\n type=\"number\"\n name=\"count\"\n value={query.nodes?.count}\n width={32}\n onChange={(e) =>\n onChange({ ...query.nodes, count: e.currentTarget.value ? parseInt(e.currentTarget.value, 10) : 0 })\n }\n placeholder=\"10\"\n />\n </InlineField>\n )}\n </InlineFieldRow>\n );\n}\n\nconst options: Array<NodesQuery['type']> = ['random', 'response'];\n","import React, { ChangeEvent } from 'react';\n\nimport { InlineField, InlineFieldRow, Input } from '@grafana/ui';\n\nimport { EditorProps } from '../QueryEditor';\nimport { PulseWaveQuery } from '../types';\n\nconst fields = [\n { label: 'Step', id: 'timeStep', placeholder: '60', tooltip: 'The number of seconds between datapoints.' },\n {\n label: 'On Count',\n id: 'onCount',\n placeholder: '3',\n tooltip: 'The number of values within a cycle, at the start of the cycle, that should have the onValue.',\n },\n { label: 'Off Count', id: 'offCount', placeholder: '6', tooltip: 'The number of offValues within the cycle.' },\n {\n label: 'On Value',\n id: 'onValue',\n placeholder: '1',\n tooltip: 'The value for \"on values\", may be an int, float, or null.',\n },\n {\n label: 'Off Value',\n id: 'offValue',\n placeholder: '1',\n tooltip: 'The value for \"off values\", may be a int, float, or null.',\n },\n];\n\nexport const PredictablePulseEditor = ({ onChange, query }: EditorProps) => {\n // Convert values to numbers before saving\n const onInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n const { name, value } = e.target;\n\n onChange({ target: { name, value: Number(value) } });\n };\n\n return (\n <InlineFieldRow>\n {fields.map(({ label, id, placeholder, tooltip }) => {\n return (\n <InlineField label={label} labelWidth={14} key={id} tooltip={tooltip}>\n <Input\n width={32}\n type=\"number\"\n name={id}\n id={`pulseWave.${id}-${query.refId}`}\n value={query.pulseWave?.[id as keyof PulseWaveQuery]}\n placeholder={placeholder}\n onChange={onInputChange}\n />\n </InlineField>\n );\n })}\n </InlineFieldRow>\n );\n};\n","import { isArray } from 'lodash';\nimport React, { useState } from 'react';\n\nimport { dataFrameToJSON, toDataFrame, toDataFrameDTO } from '@grafana/data';\nimport { toDataQueryResponse } from '@grafana/runtime';\nimport { Alert, CodeEditor } from '@grafana/ui';\n\nimport { EditorProps } from '../QueryEditor';\n\nexport const RawFrameEditor = ({ onChange, query }: EditorProps) => {\n const [error, setError] = useState<string>();\n const [warning, setWarning] = useState<string>();\n\n const onSaveFrames = (rawFrameContent: string) => {\n try {\n const json = JSON.parse(rawFrameContent);\n if (isArray(json)) {\n setError(undefined);\n setWarning(undefined);\n onChange({ ...query, rawFrameContent });\n return;\n }\n\n let data: any = undefined;\n\n // Copy paste from panel json\n if (isArray(json.series) && json.state) {\n data = json.series.map((v: any) => toDataFrameDTO(toDataFrame(v)));\n } else {\n // Chek if it is a copy of the raw resuls\n const v = toDataQueryResponse({ data: json });\n if (v.data?.length && !v.error) {\n data = v.data.map((f) => dataFrameToJSON(f));\n }\n }\n\n if (data) {\n console.log('Original', json);\n console.log('Save', data);\n setError(undefined);\n setWarning('Converted to direct frame result');\n onChange({ ...query, rawFrameContent: JSON.stringify(data, null, 2) });\n return;\n }\n\n setError('Unable to read dataframes in text');\n } catch (e) {\n console.log('Error parsing json', e);\n setError('Enter JSON array of data frames (or raw query results body)');\n setWarning(undefined);\n }\n };\n\n return (\n <>\n {error && <Alert title={error} severity=\"error\" />}\n {warning && <Alert title={warning} severity=\"warning\" />}\n <CodeEditor\n height={300}\n language=\"json\"\n value={query.rawFrameContent ?? '[]'}\n onBlur={onSaveFrames}\n onSave={onSaveFrames}\n showMiniMap={true}\n showLineNumbers={true}\n />\n </>\n );\n};\n","import React, { FormEvent, useMemo } from 'react';\nimport { useAsync } from 'react-use';\n\nimport { DataFrameJSON, SelectableValue } from '@grafana/data';\nimport {\n InlineField,\n InlineFieldRow,\n Button,\n FieldSet,\n InlineSwitch,\n Input,\n Label,\n Select,\n Form,\n TextArea,\n} from '@grafana/ui';\n\nimport { EditorProps } from '../QueryEditor';\nimport { SimulationQuery } from '../types';\n\n// Type string `json:\"type\"`\n// Name string `json:\"name\"`\n// Description string `json:\"description\"`\n// OnlyForward bool `json:\"forward\"`\n// ConfigFields *data.Frame `json:\"config\"`\n\ninterface SimInfo {\n type: string;\n name: string;\n description: string;\n forward: boolean;\n config: DataFrameJSON;\n}\ninterface FormDTO {\n config: string;\n}\nexport const SimulationQueryEditor = ({ onChange, query, ds }: EditorProps) => {\n const simQuery = query.sim ?? ({} as SimulationQuery);\n const simKey = simQuery.key ?? ({} as typeof simQuery.key);\n\n // This only changes once\n const info = useAsync(async () => {\n const v = (await ds.getResource('sims')) as SimInfo[];\n return {\n sims: v,\n options: v.map((s) => ({ label: s.name, value: s.type, description: s.description })),\n };\n }, [ds]);\n\n const current = useMemo(() => {\n const type = simKey.type;\n if (!type || !info.value) {\n return {};\n }\n return {\n details: info.value.sims.find((v) => v.type === type),\n option: info.value.options.find((v) => v.value === type),\n };\n }, [info.value, simKey?.type]);\n\n let config = useAsync(async () => {\n let path = simKey.type + '/' + simKey.tick + 'hz';\n if (simKey.uid) {\n path += '/' + simKey.uid;\n }\n return (await ds.getResource('sim/' + path))?.config;\n }, [simKey.type, simKey.tick, simKey.uid]);\n\n const onUpdateKey = (key: typeof simQuery.key) => {\n onChange({ ...query, sim: { ...simQuery, key } });\n };\n\n const onUIDChanged = (e: FormEvent<HTMLInputElement>) => {\n const { value } = e.target as HTMLInputElement;\n onUpdateKey({ ...simKey, uid: value ?? undefined });\n };\n\n const onTickChanged = (e: FormEvent<HTMLInputElement>) => {\n const tick = e.currentTarget.valueAsNumber;\n onUpdateKey({ ...simKey, tick });\n };\n\n const onTypeChange = (v: SelectableValue<string>) => {\n onUpdateKey({ ...simKey, type: v.value! });\n };\n\n const onToggleStream = () => {\n onChange({ ...query, sim: { ...simQuery, stream: !simQuery.stream } });\n };\n\n const onToggleLast = () => {\n onChange({ ...query, sim: { ...simQuery, last: !simQuery.last } });\n };\n const onSubmitChange = (data: FormDTO) => {\n let path = simKey.type + '/' + simKey.tick + 'hz';\n if (simKey.uid) {\n path += '/' + simKey.uid;\n }\n ds.postResource('sim/' + path, JSON.parse(data.config));\n };\n\n return (\n <>\n <InlineFieldRow>\n <InlineField labelWidth={14} label=\"Simulation\" tooltip=\"\">\n <Select\n isLoading={info.loading}\n options={info.value?.options ?? []}\n value={current.option}\n onChange={onTypeChange}\n width={32}\n />\n </InlineField>\n </InlineFieldRow>\n\n <InlineFieldRow>\n <InlineField labelWidth={14} label=\"Stream\" tooltip=\"connect to the live channel\">\n <InlineSwitch value={Boolean(simQuery.stream)} onChange={onToggleStream} />\n </InlineField>\n\n <InlineField label=\"Interval\" tooltip=\"the rate a simulation will spit out events\">\n <Input\n width={10}\n type=\"number\"\n value={simKey.tick}\n onChange={onTickChanged}\n min={1 / 10}\n max={50}\n suffix=\"hz\"\n />\n </InlineField>\n\n <InlineField label=\"Last\" tooltip=\"Only return the last value\">\n <Label>\n <InlineSwitch value={Boolean(simQuery.last)} onChange={onToggleLast} />\n </Label>\n </InlineField>\n <InlineField label=\"UID\" tooltip=\"A UID will allow multiple simulations to run at the same time\">\n <Input type=\"text\" placeholder=\"optional\" value={simQuery.key.uid} onChange={onUIDChanged} />\n </InlineField>\n </InlineFieldRow>\n <div>\n <Form onSubmit={onSubmitChange}>\n {({ register }) => (\n <FieldSet>\n <TextArea {...register('config')} defaultValue={JSON.stringify(config.value, null, 2)} rows={7} />\n <Button type=\"submit\">Submit</Button>\n </FieldSet>\n )}\n </Form>\n SCHEMA:\n <pre>{JSON.stringify(current.details?.config.schema, null, 2)}</pre>\n </div>\n </>\n );\n};\n","import React from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { InlineFieldRow, InlineField, Select, MultiSelect, Input } from '@grafana/ui';\n\nimport { USAQuery } from '../types';\n\nexport interface Props {\n onChange: (value: USAQuery) => void;\n query: USAQuery;\n}\n\nexport function USAQueryEditor({ query, onChange }: Props) {\n return (\n <>\n <InlineFieldRow>\n <InlineField labelWidth={14} label=\"Mode\">\n <Select\n options={usaQueryModes}\n onChange={(v) => {\n onChange({ ...query, mode: v.value });\n }}\n width={32}\n value={usaQueryModes.find((ep) => ep.value === query.mode)}\n />\n </InlineField>\n <InlineField label=\"Period\">\n <Input\n value={query.period}\n placeholder={'30m'}\n onChange={(v) => {\n onChange({ ...query, period: v.currentTarget.value });\n }}\n />\n </InlineField>\n </InlineFieldRow>\n <InlineFieldRow>\n <InlineField labelWidth={14} label=\"Fields\">\n <MultiSelect\n options={fieldNames}\n onChange={(vals: SelectableValue[]) => {\n onChange({ ...query, fields: vals.map((v) => v.value) });\n }}\n width={32}\n placeholder=\"all\"\n value={query.fields}\n />\n </InlineField>\n <InlineField label=\"States\" grow>\n <MultiSelect\n options={stateNames}\n onChange={(vals: SelectableValue[]) => {\n onChange({ ...query, states: vals.map((v) => v.value) });\n }}\n placeholder=\"all\"\n value={query.states}\n />\n </InlineField>\n </InlineFieldRow>\n </>\n );\n}\n\nexport const usaQueryModes = [\n 'values-as-rows',\n 'values-as-fields',\n 'values-as-labeled-fields',\n 'timeseries',\n 'timeseries-wide',\n].map((f) => ({ label: f, value: f }));\n\nexport const fieldNames = [\n 'foo',\n 'bar',\n 'baz', // all short\n].map((f) => ({ label: f, value: f }));\n\nexport const stateNames = [\n 'AL',\n 'AK',\n 'AZ',\n 'AR',\n 'CA',\n 'CO',\n 'CT',\n 'DE',\n 'DC',\n 'FL',\n 'GA',\n 'HI',\n 'ID',\n 'IL',\n 'IN',\n 'IA',\n 'KS',\n 'KY',\n 'LA',\n 'ME',\n 'MT',\n 'NE',\n 'NV',\n 'NH',\n 'NJ',\n 'NM',\n 'NY',\n 'NC',\n 'ND',\n 'OH',\n 'OK',\n 'OR',\n 'MD',\n 'MA',\n 'MI',\n 'MN',\n 'MS',\n 'MO',\n 'PA',\n 'RI',\n 'SC',\n 'SD',\n 'TN',\n 'TX',\n 'UT',\n 'VT',\n 'VA',\n 'WA',\n 'WV',\n 'WI',\n 'WY',\n].map((f) => ({ label: f, value: f }));\n","import { LogLevel } from '@grafana/data';\n\nlet index = 0;\n\nexport function getRandomLogLevel(): LogLevel {\n const v = Math.random();\n if (v > 0.9) {\n return LogLevel.critical;\n }\n if (v > 0.8) {\n return LogLevel.error;\n }\n if (v > 0.7) {\n return LogLevel.warning;\n }\n if (v > 0.4) {\n return LogLevel.info;\n }\n if (v > 0.3) {\n return LogLevel.debug;\n }\n if (v > 0.1) {\n return LogLevel.trace;\n }\n return LogLevel.unknown;\n}\n\nexport function getNextWord() {\n index = (index + Math.floor(Math.random() * 5)) % words.length;\n return words[index];\n}\n\nexport function getRandomLine(length = 60) {\n let line = getNextWord();\n while (line.length < length) {\n line += ' ' + getNextWord();\n }\n return line;\n}\n\nconst words = [\n 'At',\n 'vero',\n 'eos',\n 'et',\n 'accusamus',\n 'et',\n 'iusto',\n 'odio',\n 'dignissimos',\n 'ducimus',\n 'qui',\n 'blanditiis',\n 'praesentium',\n 'voluptatum',\n 'deleniti',\n 'atque',\n 'corrupti',\n 'quos',\n 'dolores',\n 'et',\n 'quas',\n 'molestias',\n 'excepturi',\n 'sint',\n 'occaecati',\n 'cupiditate',\n 'non',\n 'provident',\n 'similique',\n 'sunt',\n 'in',\n 'culpa',\n 'qui',\n 'officia',\n 'deserunt',\n 'mollitia',\n 'animi',\n 'id',\n 'est',\n 'laborum',\n 'et',\n 'dolorum',\n 'fuga',\n 'Et',\n 'harum',\n 'quidem',\n 'rerum',\n 'facilis',\n 'est',\n 'et',\n 'expedita',\n 'distinctio',\n 'Nam',\n 'libero',\n 'tempore',\n 'cum',\n 'soluta',\n 'nobis',\n 'est',\n 'eligendi',\n 'optio',\n 'cumque',\n 'nihil',\n 'impedit',\n 'quo',\n 'minus',\n 'id',\n 'quod',\n 'maxime',\n 'placeat',\n 'facere',\n 'possimus',\n 'omnis',\n 'voluptas',\n 'assumenda',\n 'est',\n 'omnis',\n 'dolor',\n 'repellendus',\n 'Temporibus',\n 'autem',\n 'quibusdam',\n 'et',\n 'aut',\n 'officiis',\n 'debitis',\n 'aut',\n 'rerum',\n 'necessitatibus',\n 'saepe',\n 'eveniet',\n 'ut',\n 'et',\n 'voluptates',\n 'repudiandae',\n 'sint',\n 'et',\n 'molestiae',\n 'non',\n 'recusandae',\n 'Itaque',\n 'earum',\n 'rerum',\n 'hic',\n 'tenetur',\n 'a',\n 'sapiente',\n 'delectus',\n 'ut',\n 'aut',\n 'reiciendis',\n 'voluptatibus',\n 'maiores',\n 'alias',\n 'consequatur',\n 'aut',\n 'perferendis',\n 'doloribus',\n 'asperiores',\n 'repellat',\n];\n","import { defaults } from 'lodash';\nimport { Observable } from 'rxjs';\n\nimport {\n DataQueryRequest,\n DataQueryResponse,\n FieldType,\n CircularDataFrame,\n CSVReader,\n Field,\n LoadingState,\n DataFrameSchema,\n DataFrameData,\n} from '@grafana/data';\nimport { liveTimer } from 'app/features/dashboard/dashgrid/liveTimer';\nimport { StreamingDataFrame } from 'app/features/live/data/StreamingDataFrame';\n\nimport { getRandomLine } from './LogIpsum';\nimport { TestDataQuery, StreamingQuery } from './types';\n\nexport const defaultStreamQuery: StreamingQuery = {\n type: 'signal',\n speed: 250, // ms\n spread: 3.5,\n noise: 2.2,\n bands: 1,\n};\n\nexport function runStream(target: TestDataQuery, req: DataQueryRequest<TestDataQuery>): Observable<DataQueryResponse> {\n const query = defaults(target.stream, defaultStreamQuery);\n if ('signal' === query.type) {\n return runSignalStream(target, query, req);\n }\n if ('logs' === query.type) {\n return runLogsStream(target, query, req);\n }\n if ('fetch' === query.type) {\n return runFetchStream(target, query, req);\n }\n throw new Error(`Unknown Stream Type: ${query.type}`);\n}\n\nexport function runSignalStream(\n target: TestDataQuery,\n query: StreamingQuery,\n req: DataQueryRequest<TestDataQuery>\n): Observable<DataQueryResponse> {\n return new Observable<DataQueryResponse>((subscriber) => {\n const streamId = `signal-${req.panelId}-${target.refId}`;\n const maxDataPoints = req.maxDataPoints || 1000;\n\n const schema: DataFrameSchema = {\n refId: target.refId,\n fields: [\n { name: 'time', type: FieldType.time },\n { name: target.alias ?? 'value', type: FieldType.number },\n ],\n };\n\n const { spread, speed, bands = 0, noise } = query;\n for (let i = 0; i < bands; i++) {\n const suffix = bands > 1 ? ` ${i + 1}` : '';\n schema.fields.push({ name: 'Min' + suffix, type: FieldType.number });\n schema.fields.push({ name: 'Max' + suffix, type: FieldType.number });\n }\n\n const frame = StreamingDataFrame.fromDataFrameJSON({ schema }, { maxLength: maxDataPoints });\n\n let value = Math.random() * 100;\n let timeoutId: any = null;\n let lastSent = -1;\n\n const addNextRow = (time: number) => {\n value += (Math.random() - 0.5) * spread;\n\n const data: DataFrameData = {\n values: [[time], [value]],\n };\n\n let min = value;\n let max = value;\n\n for (let i = 0; i < bands; i++) {\n min = min - Math.random() * noise;\n max = max + Math.random() * noise;\n\n data.values.push([min]);\n data.values.push([max]);\n }\n\n const event = { data };\n return frame.push(event);\n };\n\n // Fill the buffer on init\n if (true) {\n let time = Date.now() - maxDataPoints * speed;\n for (let i = 0; i < maxDataPoints; i++) {\n addNextRow(time);\n time += speed;\n }\n }\n\n const pushNextEvent = () => {\n addNextRow(Date.now());\n\n const elapsed = liveTimer.lastUpdate - lastSent;\n if (elapsed > 1000 || liveTimer.ok) {\n subscriber.next({\n data: [frame],\n key: streamId,\n state: LoadingState.Streaming,\n });\n lastSent = liveTimer.lastUpdate;\n }\n\n timeoutId = setTimeout(pushNextEvent, speed);\n };\n\n // Send first event in 5ms\n setTimeout(pushNextEvent, 5);\n\n return () => {\n console.log('unsubscribing to stream ' + streamId);\n clearTimeout(timeoutId);\n };\n });\n}\n\nexport function runLogsStream(\n target: TestDataQuery,\n query: StreamingQuery,\n req: DataQueryRequest<TestDataQuery>\n): Observable<DataQueryResponse> {\n return new Observable<DataQueryResponse>((subscriber) => {\n const streamId = `logs-${req.panelId}-${target.refId}`;\n const maxDataPoints = req.maxDataPoints || 1000;\n\n const data = new CircularDataFrame({\n append: 'tail',\n capacity: maxDataPoints,\n });\n data.refId = target.refId;\n data.name = target.alias || 'Logs ' + target.refId;\n data.addField({ name: 'line', type: FieldType.string });\n data.addField({ name: 'time', type: FieldType.time });\n data.meta = { preferredVisualisationType: 'logs' };\n\n const { speed } = query;\n\n let timeoutId: any = null;\n\n const pushNextEvent = () => {\n data.fields[0].values.add(Date.now());\n data.fields[1].values.add(getRandomLine());\n\n subscriber.next({\n data: [data],\n key: streamId,\n });\n\n timeoutId = setTimeout(pushNextEvent, speed);\n };\n\n // Send first event in 5ms\n setTimeout(pushNextEvent, 5);\n\n return () => {\n console.log('unsubscribing to stream ' + streamId);\n clearTimeout(timeoutId);\n };\n });\n}\n\nexport function runFetchStream(\n target: TestDataQuery,\n query: StreamingQuery,\n req: DataQueryRequest<TestDataQuery>\n): Observable<DataQueryResponse> {\n return new Observable<DataQueryResponse>((subscriber) => {\n const streamId = `fetch-${req.panelId}-${target.refId}`;\n const maxDataPoints = req.maxDataPoints || 1000;\n\n let data = new CircularDataFrame({\n append: 'tail',\n capacity: maxDataPoints,\n });\n data.refId = target.refId;\n data.name = target.alias || 'Fetch ' + target.refId;\n\n let reader: ReadableStreamReader<Uint8Array>;\n const csv = new CSVReader({\n callback: {\n onHeader: (fields: Field[]) => {\n // Clear any existing fields\n if (data.fields.length) {\n data = new CircularDataFrame({\n append: 'tail',\n capacity: maxDataPoints,\n });\n data.refId = target.refId;\n data.name = 'Fetch ' + target.refId;\n }\n for (const field of fields) {\n data.addField(field);\n }\n },\n onRow: (row: any[]) => {\n data.add(row);\n },\n },\n });\n\n const processChunk = (value: ReadableStreamDefaultReadResult<Uint8Array>): any => {\n if (value.value) {\n const text = new TextDecoder().decode(value.value);\n csv.readCSV(text);\n }\n\n subscriber.next({\n data: [data],\n key: streamId,\n state: value.done ? LoadingState.Done : LoadingState.Streaming,\n });\n\n if (value.done) {\n console.log('Finished stream');\n subscriber.complete(); // necessary?\n return;\n }\n\n return reader.read().then(processChunk);\n };\n\n if (!query.url) {\n throw new Error('query.url is not defined');\n }\n\n fetch(new Request(query.url)).then((response) => {\n if (response.body) {\n reader = response.body.getReader();\n reader.read().then(processChunk);\n }\n });\n\n return () => {\n // Cancel fetch?\n console.log('unsubscribing to stream ' + streamId);\n };\n });\n}\n","import React, { ChangeEvent, FormEvent, useMemo } from 'react';\nimport { useAsync } from 'react-use';\n\nimport { QueryEditorProps, SelectableValue } from '@grafana/data';\nimport { selectors as editorSelectors } from '@grafana/e2e-selectors';\nimport { InlineField, InlineFieldRow, InlineSwitch, Input, Select, TextArea } from '@grafana/ui';\n\nimport { RandomWalkEditor, StreamingClientEditor } from './components';\nimport { CSVContentEditor } from './components/CSVContentEditor';\nimport { CSVFileEditor } from './components/CSVFileEditor';\nimport { CSVWavesEditor } from './components/CSVWaveEditor';\nimport ErrorEditor from './components/ErrorEditor';\nimport { GrafanaLiveEditor } from './components/GrafanaLiveEditor';\nimport { NodeGraphEditor } from './components/NodeGraphEditor';\nimport { PredictablePulseEditor } from './components/PredictablePulseEditor';\nimport { RawFrameEditor } from './components/RawFrameEditor';\nimport { SimulationQueryEditor } from './components/SimulationQueryEditor';\nimport { USAQueryEditor, usaQueryModes } from './components/USAQueryEditor';\nimport { defaultCSVWaveQuery, defaultPulseQuery, defaultQuery } from './constants';\nimport { TestDataDataSource } from './datasource';\nimport { defaultStreamQuery } from './runStreams';\nimport { CSVWave, NodesQuery, TestDataQuery, USAQuery } from './types';\n\nconst showLabelsFor = ['random_walk', 'predictable_pulse'];\nconst endpoints = [\n { value: 'datasources', label: 'Data Sources' },\n { value: 'search', label: 'Search' },\n { value: 'annotations', label: 'Annotations' },\n];\n\nconst selectors = editorSelectors.components.DataSource.TestData.QueryTab;\n\nexport interface EditorProps {\n onChange: (value: any) => void;\n query: TestDataQuery;\n ds: TestDataDataSource;\n}\n\nexport type Props = QueryEditorProps<TestDataDataSource, TestDataQuery>;\n\nexport const QueryEditor = ({ query, datasource, onChange, onRunQuery }: Props) => {\n query = { ...defaultQuery, ...query };\n\n const { loading, value: scenarioList } = useAsync(async () => {\n // migrate manual_entry (unusable since 7, removed in 8)\n if (query.scenarioId === 'manual_entry' && (query as any).points) {\n let csvContent = 'Time,Value\\n';\n for (const point of (query as any).points) {\n csvContent += `${point[1]},${point[0]}\\n`;\n }\n onChange({\n refId: query.refId,\n datasource: query.datasource,\n scenarioId: 'csv_content',\n csvContent,\n });\n }\n\n const vals = await datasource.getScenarios();\n const hideAlias = ['simulation'];\n return vals.map((v) => ({\n ...v,\n hideAliasField: hideAlias.includes(v.id),\n }));\n }, []);\n\n const onUpdate = (query: TestDataQuery) => {\n onChange(query);\n onRunQuery();\n };\n\n const currentScenario = useMemo(\n () => scenarioList?.find((scenario) => scenario.id === query.scenarioId),\n [scenarioList, query]\n );\n const scenarioId = currentScenario?.id;\n const description = currentScenario?.description;\n\n const onScenarioChange = (item: SelectableValue<string>) => {\n const scenario = scenarioList?.find((sc) => sc.id === item.value);\n\n if (!scenario) {\n return;\n }\n\n // Clear model from existing props that belong to other scenarios\n const update: TestDataQuery = {\n scenarioId: item.value!,\n refId: query.refId,\n alias: query.alias,\n datasource: query.datasource,\n };\n\n if (scenario.stringInput) {\n update.stringInput = scenario.stringInput;\n }\n\n switch (scenario.id) {\n case 'grafana_api':\n update.stringInput = 'datasources';\n break;\n case 'streaming_client':\n update.stream = defaultStreamQuery;\n break;\n case 'live':\n update.channel = 'random-2s-stream'; // default stream\n break;\n case 'simulation':\n update.sim = { key: { type: 'flight', tick: 10 } }; // default stream\n break;\n case 'predictable_pulse':\n update.pulseWave = defaultPulseQuery;\n break;\n case 'predictable_csv_wave':\n update.csvWave = defaultCSVWaveQuery;\n break;\n case 'usa':\n update.usa = {\n mode: usaQueryModes[0].value,\n };\n }\n\n onUpdate(update);\n };\n\n const onInputChange = (e: FormEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n const { name, value, type } = e.target as HTMLInputElement | HTMLTextAreaElement;\n let newValue: any = value;\n\n if (type === 'number') {\n newValue = Number(value);\n }\n\n if (name === 'levelColumn') {\n newValue = (e.target as HTMLInputElement).checked;\n }\n\n onUpdate({ ...query, [name]: newValue });\n };\n\n const onFieldChange = (field: string) => (e: ChangeEvent<HTMLInputElement>) => {\n const { name, value, type } = e.target as HTMLInputElement;\n let newValue: any = value;\n\n if (type === 'number') {\n newValue = Number(value);\n }\n\n onUpdate({ ...query, [field]: { ...(query as any)[field], [name]: newValue } });\n };\n\n const onEndPointChange = ({ value }: SelectableValue) => {\n onUpdate({ ...query, stringInput: value });\n };\n\n const onStreamClientChange = onFieldChange('stream');\n const onPulseWaveChange = onFieldChange('pulseWave');\n const onUSAStatsChange = (usa?: USAQuery) => {\n onUpdate({ ...query, usa });\n };\n\n const onCSVWaveChange = (csvWave?: CSVWave[]) => {\n onUpdate({ ...query, csvWave });\n };\n\n const options = useMemo(\n () =>\n (scenarioList || [])\n .map((item) => ({ label: item.name, value: item.id }))\n .sort((a, b) => a.label.localeCompare(b.label)),\n [scenarioList]\n );\n const showLabels = useMemo(() => showLabelsFor.includes(query.scenarioId ?? ''), [query]);\n\n if (loading) {\n return null;\n }\n\n return (\n <>\n <InlineFieldRow aria-label={selectors.scenarioSelectContainer}>\n <InlineField labelWidth={14} label=\"Scenario\">\n <Select\n inputId={`test-data-scenario-select-${query.refId}`}\n options={options}\n value={options.find((item) => item.value === query.scenarioId)}\n onChange={onScenarioChange}\n width={32}\n />\n </InlineField>\n {currentScenario?.stringInput && (\n <InlineField label=\"String Input\">\n <Input\n width={32}\n id={`stringInput-${query.refId}`}\n name=\"stringInput\"\n placeholder={query.stringInput}\n value={query.stringInput}\n onChange={onInputChange}\n />\n </InlineField>\n )}\n {Boolean(!currentScenario?.hideAliasField) && (\n <InlineField label=\"Alias\" labelWidth={14}>\n <Input\n width={32}\n id={`alias-${query.refId}`}\n type=\"text\"\n placeholder=\"optional\"\n pattern='[^<>&\\\\\"]+'\n name=\"alias\"\n value={query.alias}\n onChange={onInputChange}\n />\n </InlineField>\n )}\n {showLabels && (\n <InlineField\n label=\"Labels\"\n labelWidth={14}\n tooltip={\n <>\n Set labels using a key=value syntax:\n <br />\n {`{ key = \"value\", key2 = \"value\" }`}\n <br />\n key="value", key2="value"\n <br />\n key=value, key2=value\n <br />\n </>\n }\n >\n <Input\n width={32}\n id={`labels-${query.refId}`}\n name=\"labels\"\n onChange={onInputChange}\n value={query?.labels}\n placeholder=\"key=value, key2=value2\"\n />\n </InlineField>\n )}\n </InlineFieldRow>\n\n {scenarioId === 'random_walk' && <RandomWalkEditor onChange={onInputChange} query={query} ds={datasource} />}\n {scenarioId === 'streaming_client' && (\n <StreamingClientEditor onChange={onStreamClientChange} query={query} ds={datasource} />\n )}\n {scenarioId === 'live' && <GrafanaLiveEditor onChange={onUpdate} query={query} ds={datasource} />}\n {scenarioId === 'simulation' && <SimulationQueryEditor onChange={onUpdate} query={query} ds={datasource} />}\n {scenarioId === 'raw_frame' && <RawFrameEditor onChange={onUpdate} query={query} ds={datasource} />}\n {scenarioId === 'csv_file' && <CSVFileEditor onChange={onUpdate} query={query} ds={datasource} />}\n {scenarioId === 'csv_content' && <CSVContentEditor onChange={onUpdate} query={query} ds={datasource} />}\n {scenarioId === 'logs' && (\n <InlineFieldRow>\n <InlineField label=\"Lines\" labelWidth={14}>\n <Input\n type=\"number\"\n name=\"lines\"\n value={query.lines}\n width={32}\n onChange={onInputChange}\n placeholder=\"10\"\n />\n </InlineField>\n <InlineField label=\"Level\" labelWidth={14}>\n <InlineSwitch onChange={onInputChange} name=\"levelColumn\" value={!!query.levelColumn} />\n </InlineField>\n </InlineFieldRow>\n )}\n\n {scenarioId === 'usa' && <USAQueryEditor onChange={onUSAStatsChange} query={query.usa ?? {}} />}\n {scenarioId === 'grafana_api' && (\n <InlineField labelWidth={14} label=\"Endpoint\">\n <Select\n options={endpoints}\n onChange={onEndPointChange}\n width={32}\n value={endpoints.find((ep) => ep.value === query.stringInput)}\n />\n </InlineField>\n )}\n\n {scenarioId === 'arrow' && (\n <InlineField grow>\n <TextArea\n name=\"stringInput\"\n value={query.stringInput}\n rows={10}\n placeholder=\"Copy base64 text data from query result\"\n onChange={onInputChange}\n />\n </InlineField>\n )}\n\n {scenarioId === 'predictable_pulse' && (\n <PredictablePulseEditor onChange={onPulseWaveChange} query={query} ds={datasource} />\n )}\n {scenarioId === 'predictable_csv_wave' && <CSVWavesEditor onChange={onCSVWaveChange} waves={query.csvWave} />}\n {scenarioId === 'node_graph' && (\n <NodeGraphEditor onChange={(val: NodesQuery) => onChange({ ...query, nodes: val })} query={query} />\n )}\n {scenarioId === 'server_error_500' && <ErrorEditor onChange={onUpdate} query={query} ds={datasource} />}\n\n {description && <p>{description}</p>}\n </>\n );\n};\n","// Libraries\nimport React, { PureComponent } from 'react';\n\nimport { PluginConfigPageProps, DataSourcePluginMeta, DataSourceJsonData } from '@grafana/data';\nimport { LinkButton } from '@grafana/ui';\n\n// Types\n\ninterface Props extends PluginConfigPageProps<DataSourcePluginMeta<DataSourceJsonData>> {}\n\nexport class TestInfoTab extends PureComponent<Props> {\n constructor(props: Props) {\n super(props);\n }\n\n render() {\n return (\n <div>\n See github for more information about setting up a reproducible test environment.\n <br />\n <br />\n <LinkButton\n variant=\"secondary\"\n href=\"https://github.com/grafana/grafana/tree/main/devenv\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n GitHub\n </LinkButton>\n <br />\n </div>\n );\n }\n}\n","export interface TreeNode {\n name: string;\n children: TreeNode[];\n}\n\n/*\n * Builds a nested tree like\n * [\n * {\n * name: 'A',\n * children: [\n * { name: 'AA', children: [] },\n * { name: 'AB', children: [] },\n * ]\n * }\n * ]\n */\nfunction buildMetricTree(parent: string, depth: number): TreeNode[] {\n const chars = ['A', 'B', 'C'];\n const children: TreeNode[] = [];\n\n if (depth > 5) {\n return [];\n }\n\n for (const letter of chars) {\n const nodeName = `${parent}${letter}`;\n children.push({\n name: nodeName,\n children: buildMetricTree(nodeName, depth + 1),\n });\n }\n\n return children;\n}\n\nfunction queryTree(children: TreeNode[], query: string[], queryIndex: number): TreeNode[] {\n if (queryIndex >= query.length) {\n return children;\n }\n\n if (query[queryIndex] === '*') {\n return children;\n }\n\n const nodeQuery = query[queryIndex];\n let result: TreeNode[] = [];\n let namesToMatch = [nodeQuery];\n\n // handle glob queries\n if (nodeQuery.startsWith('{')) {\n namesToMatch = nodeQuery.replace(/\\{|\\}/g, '').split(',');\n }\n\n for (const node of children) {\n for (const nameToMatch of namesToMatch) {\n if (nameToMatch.indexOf('*') !== -1) {\n const pattern = nameToMatch.replace('*', '');\n const regex = new RegExp(`^${pattern}.*`, 'gi');\n if (regex.test(node.name)) {\n result = result.concat(queryTree([node], query, queryIndex + 1));\n }\n } else if (node.name === nameToMatch) {\n result = result.concat(queryTree(node.children, query, queryIndex + 1));\n }\n }\n }\n\n return result;\n}\n\nexport function queryMetricTree(query: string): TreeNode[] {\n if (query.indexOf('value') === 0) {\n return [{ name: query, children: [] }];\n }\n\n const children = buildMetricTree('', 0);\n return queryTree(children, query.split('.'), 0);\n}\n","import { FieldColorModeId, FieldType, PreferredVisualisationType, NodeGraphDataFrameFieldNames } from '@grafana/data';\n\nexport const nodes = {\n fields: [\n {\n name: NodeGraphDataFrameFieldNames.id,\n type: FieldType.string,\n config: {\n links: [\n {\n title: 'Traces/All',\n url: '',\n internal: {\n query: {\n queryType: 'getTraceSummaries',\n query: 'service(id(name: \"${__data.fields.name}\", type: \"${__data.fields.type}\"))',\n },\n datasourceUid: 'Ax4erxHGz',\n datasourceName: 'Trace data source',\n },\n },\n {\n title: 'Traces/OK',\n url: '',\n internal: {\n query: {\n queryType: 'getTraceSummaries',\n query: 'service(id(name: \"${__data.fields.name}\", type: \"${__data.fields.type}\")) { ok = true }',\n },\n datasourceUid: 'Ax4erxHGz',\n datasourceName: 'Trace data source',\n },\n },\n {\n title: 'Traces/Errors',\n url: '',\n internal: {\n query: {\n queryType: 'getTraceSummaries',\n query: 'service(id(name: \"${__data.fields.name}\", type: \"${__data.fields.type}\")) { error = true }',\n },\n datasourceUid: 'Ax4erxHGz',\n datasourceName: 'Trace data source',\n },\n },\n {\n title: 'Traces/Faults',\n url: '',\n internal: {\n query: {\n queryType: 'getTraceSummaries',\n query: 'service(id(name: \"${__data.fields.name}\", type: \"${__data.fields.type}\")) { fault = true }',\n },\n datasourceUid: 'Ax4erxHGz',\n datasourceName: 'Trace data source',\n },\n },\n ],\n },\n values: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],\n },\n {\n name: NodeGraphDataFrameFieldNames.title,\n type: FieldType.string,\n config: { displayName: 'Name' },\n values: [\n 'auth',\n 'products',\n 'customers',\n 'orders',\n 'products',\n 'orders',\n 'api',\n 'shipping',\n 'orders',\n 'execute-api',\n 'shipping',\n 'www',\n 'api',\n 'www',\n 'products',\n ],\n },\n {\n name: NodeGraphDataFrameFieldNames.subTitle,\n type: FieldType.string,\n config: { displayName: 'Type' },\n values: [\n 'Compute',\n 'SQL',\n 'SQL',\n 'SQL',\n 'remote',\n 'Function',\n 'Compute',\n 'Function',\n 'Function',\n 'remote',\n 'Function',\n 'Compute',\n 'client',\n 'client',\n 'Compute',\n ],\n },\n {\n name: NodeGraphDataFrameFieldNames.mainStat,\n type: FieldType.number,\n config: { unit: 'ms/t', displayName: 'Average response time' },\n values: [\n 3.5394042646735553, 15.906441318223264, 4.913011921591567, 7.4163203042094095, 1092, 22.85961441405067,\n 56.135855729084696, 4.45946191601527, 12.818300278280843, 4.25, 12.565442646791492, 77.63447512700567,\n 40.387096774193544, 77.63447512700567, 27.648950187374872,\n ],\n },\n {\n name: NodeGraphDataFrameFieldNames.secondaryStat,\n type: FieldType.number,\n config: { unit: 't/min', displayName: 'Transactions per minute' },\n values: [\n 50.56317154501667, 682.4, 512.8416666666667, 125.64444444444445, 0.005585812037424941, 137.59722222222223,\n 300.0527777777778, 30.582348853370394, 125.77222222222223, 0.028706417080318163, 30.582348853370394, 165.675,\n 0.100021510002151, 165.675, 162.33055555555555,\n ],\n },\n {\n name: NodeGraphDataFrameFieldNames.arc + 'success',\n type: FieldType.number,\n config: { color: { mode: FieldColorModeId.Fixed, fixedColor: 'green' }, displayName: 'Sucesss' },\n values: [\n 0.9338865684765882, 1, 1, 1, 0.5, 1, 0.9901128505170387, 0.9069260134520997, 1, 0, 0.9069260134520997,\n 0.9624432037288534, 0, 0.9624432037288534, 0.9824945669843769,\n ],\n },\n {\n name: NodeGraphDataFrameFieldNames.arc + 'faults',\n type: FieldType.number,\n config: { color: { mode: FieldColorModeId.Fixed, fixedColor: 'red' }, displayName: 'Faults' },\n values: [\n 0, 0, 0, 0, 0.5, 0, 0.009479813736472288, 0, 0, 0, 0, 0.017168821152524185, 0, 0.017168821152524185,\n 0.01750543301562313,\n ],\n },\n {\n name: NodeGraphDataFrameFieldNames.arc + 'errors',\n type: FieldType.number,\n config: { color: { mode: FieldColorModeId.Fixed, fixedColor: 'semi-dark-yellow' }, displayName: 'Errors' },\n values: [\n 0.06611343152341174, 0, 0, 0, 0, 0, 0.0004073357464890436, 0.09307398654790038, 0, 1, 0.09307398654790038,\n 0.02038797511862247, 1, 0.02038797511862247, 0,\n ],\n },\n {\n name: NodeGraphDataFrameFieldNames.arc + 'throttled',\n type: FieldType.number,\n config: { color: { mode: FieldColorModeId.Fixed, fixedColor: 'purple' }, displayName: 'Throttled' },\n values: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n },\n ],\n meta: { preferredVisualisationType: 'nodeGraph' as PreferredVisualisationType },\n name: 'nodes',\n};\n\nexport const edges = {\n fields: [\n {\n name: NodeGraphDataFrameFieldNames.id,\n type: FieldType.string,\n config: {\n links: [\n {\n title: 'Traces/All',\n url: '',\n internal: {\n query: {\n queryType: 'getTraceSummaries',\n query: 'edge(\"${__data.fields.sourceName}\", \"${__data.fields.targetName}\")',\n },\n datasourceUid: 'Ax4erxHGz',\n datasourceName: 'Trace data source',\n },\n },\n {\n title: 'Traces/OK',\n url: '',\n internal: {\n query: {\n queryType: 'getTraceSummaries',\n query: 'edge(\"${__data.fields.sourceName}\", \"${__data.fields.targetName}\") { ok = true }',\n },\n datasourceUid: 'Ax4erxHGz',\n datasourceName: 'Trace data source',\n },\n },\n {\n title: 'Traces/Errors',\n url: '',\n internal: {\n query: {\n queryType: 'getTraceSummaries',\n query: 'edge(\"${__data.fields.sourceName}\", \"${__data.fields.targetName}\") { error = true }',\n },\n datasourceUid: 'Ax4erxHGz',\n datasourceName: 'Trace data source',\n },\n },\n {\n title: 'Traces/Faults',\n url: '',\n internal: {\n query: {\n queryType: 'getTraceSummaries',\n query: 'edge(\"${__data.fields.sourceName}\", \"${__data.fields.targetName}\") { fault = true }',\n },\n datasourceUid: 'Ax4erxHGz',\n datasourceName: 'Trace data source',\n },\n },\n ],\n },\n values: [\n '0__2',\n '5__8',\n '6__0',\n '6__5',\n '6__9',\n '6__2',\n '6__14',\n '6__4',\n '8__3',\n '10__7',\n '11__0',\n '11__6',\n '12__6',\n '13__11',\n '14__1',\n '14__2',\n '14__10',\n ],\n },\n {\n name: NodeGraphDataFrameFieldNames.source,\n type: FieldType.string,\n config: {},\n values: [0, 5, 6, 6, 6, 6, 6, 6, 8, 10, 11, 11, 12, 13, 14, 14, 14],\n },\n {\n name: 'sourceName',\n type: FieldType.string,\n config: {},\n values: [\n 'auth',\n 'orders',\n 'api',\n 'api',\n 'api',\n 'api',\n 'api',\n 'api',\n 'orders',\n 'shipping',\n 'www',\n 'www',\n 'api',\n 'www',\n 'products',\n 'products',\n 'products',\n ],\n },\n {\n name: NodeGraphDataFrameFieldNames.target,\n type: FieldType.string,\n config: {},\n values: [2, 8, 0, 5, 9, 2, 14, 4, 3, 7, 0, 6, 6, 11, 1, 2, 10],\n },\n {\n name: 'targetName',\n type: FieldType.string,\n config: {},\n values: [\n 'customers',\n 'orders',\n 'auth',\n 'orders',\n 'execute-api',\n 'customers',\n 'products',\n 'products',\n 'orders',\n 'shipping',\n 'auth',\n 'api',\n 'api',\n 'www',\n 'products',\n 'customers',\n 'shipping',\n ],\n },\n {\n name: NodeGraphDataFrameFieldNames.mainStat,\n type: FieldType.string,\n config: { displayName: 'Response percentage' },\n values: [\n 'Success 100.00%',\n 'Success 100.00%',\n 'Success 100.00%',\n 'Success 100.00%',\n 'Errors 100.00%',\n 'Success 100.00%',\n 'Faults 1.75%',\n 'Faults 50.00%',\n 'Success 100.00%',\n 'Errors 9.31%',\n 'Errors 6.62%',\n 'Faults 1.13%',\n 'Errors 100.00%',\n 'Faults 1.72%',\n 'Success 100.00%',\n 'Success 100.00%',\n 'Faults 9.30%',\n ],\n },\n {\n name: NodeGraphDataFrameFieldNames.secondaryStat,\n type: FieldType.number,\n config: { unit: 't/min', displayName: 'Transactions per minute' },\n values: [\n 50.56317154501667, 125.77222222222223, 0.03333333333333333, 137.59722222222223, 0.022222222222222223,\n 299.96666666666664, 162.33055555555555, 0.005555555555555556, 125.64444444444445, 30.582348853370394,\n 50.51111111111111, 299.9166666666667, 0.100021510002151, 165.675, 682.4, 162.33055555555555, 30.558333333333334,\n ],\n },\n ],\n meta: { preferredVisualisationType: 'nodeGraph' as PreferredVisualisationType },\n name: 'edges',\n};\n","import {\n ArrayVector,\n FieldColorModeId,\n FieldDTO,\n FieldType,\n MutableDataFrame,\n NodeGraphDataFrameFieldNames,\n} from '@grafana/data';\n\nimport { nodes, edges } from './testData/serviceMapResponse';\n\nexport function generateRandomNodes(count = 10) {\n const nodes = [];\n\n const root = {\n id: '0',\n title: 'root',\n subTitle: 'client',\n success: 1,\n error: 0,\n stat1: Math.random(),\n stat2: Math.random(),\n edges: [] as any[],\n };\n nodes.push(root);\n const nodesWithoutMaxEdges = [root];\n\n const maxEdges = 3;\n\n for (let i = 1; i < count; i++) {\n const node = makeRandomNode(i);\n nodes.push(node);\n const sourceIndex = Math.floor(Math.random() * Math.floor(nodesWithoutMaxEdges.length - 1));\n const source = nodesWithoutMaxEdges[sourceIndex];\n source.edges.push(node.id);\n if (source.edges.length >= maxEdges) {\n nodesWithoutMaxEdges.splice(sourceIndex, 1);\n }\n nodesWithoutMaxEdges.push(node);\n }\n\n // Add some random edges to create possible cycle\n const additionalEdges = Math.floor(count / 2);\n for (let i = 0; i <= additionalEdges; i++) {\n const sourceIndex = Math.floor(Math.random() * Math.floor(nodes.length - 1));\n const targetIndex = Math.floor(Math.random() * Math.floor(nodes.length - 1));\n if (sourceIndex === targetIndex || nodes[sourceIndex].id === '0' || nodes[sourceIndex].id === '0') {\n continue;\n }\n\n nodes[sourceIndex].edges.push(nodes[sourceIndex].id);\n }\n\n const nodeFields: Record<string, Omit<FieldDTO, 'name'> & { values: ArrayVector }> = {\n [NodeGraphDataFrameFieldNames.id]: {\n values: new ArrayVector(),\n type: FieldType.string,\n },\n [NodeGraphDataFrameFieldNames.title]: {\n values: new ArrayVector(),\n type: FieldType.string,\n },\n [NodeGraphDataFrameFieldNames.subTitle]: {\n values: new ArrayVector(),\n type: FieldType.string,\n },\n [NodeGraphDataFrameFieldNames.mainStat]: {\n values: new ArrayVector(),\n type: FieldType.number,\n config: { displayName: 'Transactions per second' },\n },\n [NodeGraphDataFrameFieldNames.secondaryStat]: {\n values: new ArrayVector(),\n type: FieldType.number,\n config: { displayName: 'Average duration' },\n },\n [NodeGraphDataFrameFieldNames.arc + 'success']: {\n values: new ArrayVector(),\n type: FieldType.number,\n config: { color: { fixedColor: 'green', mode: FieldColorModeId.Fixed }, displayName: 'Success' },\n },\n [NodeGraphDataFrameFieldNames.arc + 'errors']: {\n values: new ArrayVector(),\n type: FieldType.number,\n config: { color: { fixedColor: 'red', mode: FieldColorModeId.Fixed }, displayName: 'Errors' },\n },\n };\n\n const nodeFrame = new MutableDataFrame({\n name: 'nodes',\n fields: Object.keys(nodeFields).map((key) => ({\n ...nodeFields[key],\n name: key,\n })),\n meta: { preferredVisualisationType: 'nodeGraph' },\n });\n\n const edgeFields: any = {\n [NodeGraphDataFrameFieldNames.id]: {\n values: new ArrayVector(),\n type: FieldType.string,\n },\n [NodeGraphDataFrameFieldNames.source]: {\n values: new ArrayVector(),\n type: FieldType.string,\n },\n [NodeGraphDataFrameFieldNames.target]: {\n values: new ArrayVector(),\n type: FieldType.string,\n },\n };\n\n const edgesFrame = new MutableDataFrame({\n name: 'edges',\n fields: Object.keys(edgeFields).map((key) => ({\n ...edgeFields[key],\n name: key,\n })),\n meta: { preferredVisualisationType: 'nodeGraph' },\n });\n\n const edgesSet = new Set();\n for (const node of nodes) {\n nodeFields.id.values.add(node.id);\n nodeFields.title.values.add(node.title);\n nodeFields.subTitle.values.add(node.subTitle);\n nodeFields.mainStat.values.add(node.stat1);\n nodeFields.secondaryStat.values.add(node.stat2);\n nodeFields.arc__success.values.add(node.success);\n nodeFields.arc__errors.values.add(node.error);\n for (const edge of node.edges) {\n const id = `${node.id}--${edge}`;\n // We can have duplicate edges when we added some more by random\n if (edgesSet.has(id)) {\n continue;\n }\n edgesSet.add(id);\n edgeFields.id.values.add(`${node.id}--${edge}`);\n edgeFields.source.values.add(node.id);\n edgeFields.target.values.add(edge);\n }\n }\n\n return [nodeFrame, edgesFrame];\n}\n\nfunction makeRandomNode(index: number) {\n const success = Math.random();\n const error = 1 - success;\n return {\n id: index.toString(),\n title: `service:${index}`,\n subTitle: 'service',\n success,\n error,\n stat1: Math.random(),\n stat2: Math.random(),\n edges: [],\n };\n}\n\nexport function savedNodesResponse(): any {\n return [new MutableDataFrame(nodes), new MutableDataFrame(edges)];\n}\n","import { StandardVariableQuery, StandardVariableSupport } from '@grafana/data';\n\nimport { TestDataDataSource } from './datasource';\nimport { TestDataQuery } from './types';\n\nexport class TestDataVariableSupport extends StandardVariableSupport<TestDataDataSource> {\n toDataQuery(query: StandardVariableQuery): TestDataQuery {\n return {\n refId: 'TestDataDataSource-QueryVariable',\n stringInput: query.query,\n scenarioId: 'variables-query',\n csvWave: undefined,\n };\n }\n}\n","import { from, merge, Observable, of, throwError } from 'rxjs';\nimport { delay } from 'rxjs/operators';\n\nimport {\n AnnotationEvent,\n ArrayDataFrame,\n DataFrame,\n DataQueryRequest,\n DataQueryResponse,\n DataSourceInstanceSettings,\n DataTopic,\n LiveChannelScope,\n LoadingState,\n TimeRange,\n ScopedVars,\n toDataFrame,\n} from '@grafana/data';\nimport { DataSourceWithBackend, getBackendSrv, getGrafanaLiveSrv, getTemplateSrv, TemplateSrv } from '@grafana/runtime';\nimport { getSearchFilterScopedVar } from 'app/features/variables/utils';\n\nimport { queryMetricTree } from './metricTree';\nimport { generateRandomNodes, savedNodesResponse } from './nodeGraphUtils';\nimport { runStream } from './runStreams';\nimport { Scenario, TestDataQuery } from './types';\nimport { TestDataVariableSupport } from './variables';\n\nexport class TestDataDataSource extends DataSourceWithBackend<TestDataQuery> {\n scenariosCache?: Promise<Scenario[]>;\n\n constructor(\n instanceSettings: DataSourceInstanceSettings,\n private readonly templateSrv: TemplateSrv = getTemplateSrv()\n ) {\n super(instanceSettings);\n this.variables = new TestDataVariableSupport();\n }\n\n query(options: DataQueryRequest<TestDataQuery>): Observable<DataQueryResponse> {\n const backendQueries: TestDataQuery[] = [];\n const streams: Array<Observable<DataQueryResponse>> = [];\n\n // Start streams and prepare queries\n for (const target of options.targets) {\n if (target.hide) {\n continue;\n }\n\n this.resolveTemplateVariables(target, options.scopedVars);\n\n switch (target.scenarioId) {\n case 'live':\n streams.push(runGrafanaLiveQuery(target, options));\n break;\n case 'streaming_client':\n streams.push(runStream(target, options));\n break;\n case 'grafana_api':\n streams.push(runGrafanaAPI(target, options));\n break;\n case 'annotations':\n streams.push(this.annotationDataTopicTest(target, options));\n break;\n case 'variables-query':\n streams.push(this.variablesQuery(target, options));\n break;\n case 'node_graph':\n streams.push(this.nodesQuery(target, options));\n break;\n case 'raw_frame':\n streams.push(this.rawFrameQuery(target, options));\n break;\n case 'server_error_500':\n // this now has an option where it can return/throw an error from the frontend.\n // if it doesn't, send it to the backend where it might panic there :)\n const query = this.serverErrorQuery(target, options);\n query ? streams.push(query) : backendQueries.push(target);\n break;\n // Unusable since 7, removed in 8\n case 'manual_entry': {\n let csvContent = 'Time,Value\\n';\n if ((target as any).points) {\n for (const point of (target as any).points) {\n csvContent += `${point[1]},${point[0]}\\n`;\n }\n }\n target.scenarioId = 'csv_content';\n target.csvContent = csvContent;\n }\n\n default:\n backendQueries.push(target);\n }\n }\n\n if (backendQueries.length) {\n const backendOpts = {\n ...options,\n targets: backendQueries,\n };\n streams.push(super.query(backendOpts));\n }\n\n if (streams.length === 0) {\n return of({ data: [] });\n }\n\n return merge(...streams);\n }\n\n resolveTemplateVariables(query: TestDataQuery, scopedVars: ScopedVars) {\n if (query.labels) {\n query.labels = this.templateSrv.replace(query.labels, scopedVars);\n }\n if (query.alias) {\n query.alias = this.templateSrv.replace(query.alias, scopedVars);\n }\n if (query.scenarioId) {\n query.scenarioId = this.templateSrv.replace(query.scenarioId, scopedVars);\n }\n if (query.stringInput) {\n query.stringInput = this.templateSrv.replace(query.stringInput, scopedVars);\n }\n if (query.csvContent) {\n query.csvContent = this.templateSrv.replace(query.csvContent, scopedVars);\n }\n if (query.rawFrameContent) {\n query.rawFrameContent = this.templateSrv.replace(query.rawFrameContent, scopedVars);\n }\n }\n\n annotationDataTopicTest(target: TestDataQuery, req: DataQueryRequest<TestDataQuery>): Observable<DataQueryResponse> {\n const events = this.buildFakeAnnotationEvents(req.range, 50);\n const dataFrame = new ArrayDataFrame(events);\n dataFrame.meta = { dataTopic: DataTopic.Annotations };\n\n return of({ key: target.refId, data: [dataFrame] }).pipe(delay(100));\n }\n\n buildFakeAnnotationEvents(range: TimeRange, count: number): AnnotationEvent[] {\n let timeWalker = range.from.valueOf();\n const to = range.to.valueOf();\n const events = [];\n const step = (to - timeWalker) / count;\n\n for (let i = 0; i < count; i++) {\n events.push({\n time: timeWalker,\n text: 'This is the text, <a href=\"https://grafana.com\">Grafana.com</a>',\n tags: ['text', 'server'],\n });\n timeWalker += step;\n }\n\n return events;\n }\n\n annotationQuery(options: any) {\n return Promise.resolve(this.buildFakeAnnotationEvents(options.range, 10));\n }\n\n getQueryDisplayText(query: TestDataQuery) {\n const scenario = query.scenarioId ?? 'Default scenario';\n\n if (query.alias) {\n return scenario + ' as ' + query.alias;\n }\n\n return scenario;\n }\n\n testDatasource() {\n return Promise.resolve({\n status: 'success',\n message: 'Data source is working',\n });\n }\n\n getScenarios(): Promise<Scenario[]> {\n if (!this.scenariosCache) {\n this.scenariosCache = this.getResource('scenarios');\n }\n\n return this.scenariosCache;\n }\n\n variablesQuery(target: TestDataQuery, options: DataQueryRequest<TestDataQuery>): Observable<DataQueryResponse> {\n const query = target.stringInput ?? '';\n const interpolatedQuery = this.templateSrv.replace(\n query,\n getSearchFilterScopedVar({ query, wildcardChar: '*', options: options.scopedVars })\n );\n const children = queryMetricTree(interpolatedQuery);\n const items = children.map((item) => ({ value: item.name, text: item.name }));\n const dataFrame = new ArrayDataFrame(items);\n\n return of({ data: [dataFrame] }).pipe(delay(100));\n }\n\n nodesQuery(target: TestDataQuery, options: DataQueryRequest<TestDataQuery>): Observable<DataQueryResponse> {\n const type = target.nodes?.type || 'random';\n let frames: DataFrame[];\n switch (type) {\n case 'random':\n frames = generateRandomNodes(target.nodes?.count);\n break;\n case 'response':\n frames = savedNodesResponse();\n break;\n default:\n throw new Error(`Unknown node_graph sub type ${type}`);\n }\n\n return of({ data: frames }).pipe(delay(100));\n }\n\n rawFrameQuery(target: TestDataQuery, options: DataQueryRequest<TestDataQuery>): Observable<DataQueryResponse> {\n try {\n const data = JSON.parse(target.rawFrameContent ?? '[]').map((v: any) => {\n const f = toDataFrame(v);\n f.refId = target.refId;\n return f;\n });\n return of({ data, state: LoadingState.Done }).pipe(delay(100));\n } catch (ex) {\n return of({ data: [], error: ex }).pipe(delay(100));\n }\n }\n\n serverErrorQuery(\n target: TestDataQuery,\n options: DataQueryRequest<TestDataQuery>\n ): Observable<DataQueryResponse> | null {\n const { errorType } = target;\n console.log(\"we're here!\", target);\n\n if (errorType === 'server_panic') {\n return null;\n }\n\n const stringInput = target.stringInput ?? '';\n if (stringInput === '') {\n if (errorType === 'frontend_exception') {\n throw new Error('Scenario threw an exception in the frontend because the input was empty.');\n } else {\n return throwError(() => new Error('Scenario returned an error because the input was empty.'));\n }\n }\n\n return null;\n }\n}\n\nfunction runGrafanaAPI(target: TestDataQuery, req: DataQueryRequest<TestDataQuery>): Observable<DataQueryResponse> {\n const url = `/api/${target.stringInput}`;\n return from(\n getBackendSrv()\n .get(url)\n .then((res) => {\n const frame = new ArrayDataFrame(res);\n return {\n state: LoadingState.Done,\n data: [frame],\n };\n })\n );\n}\n\nlet liveQueryCounter = 1000;\n\nfunction runGrafanaLiveQuery(\n target: TestDataQuery,\n req: DataQueryRequest<TestDataQuery>\n): Observable<DataQueryResponse> {\n if (!target.channel) {\n throw new Error(`Missing channel config`);\n }\n return getGrafanaLiveSrv().getDataStream({\n addr: {\n scope: LiveChannelScope.Plugin,\n namespace: 'testdata',\n path: target.channel,\n },\n key: `testStream.${liveQueryCounter++}`,\n });\n}\n","import { DataSourcePlugin } from '@grafana/data';\n\nimport { ConfigEditor } from './ConfigEditor';\nimport { QueryEditor } from './QueryEditor';\nimport { TestInfoTab } from './TestInfoTab';\nimport { TestDataDataSource } from './datasource';\n\nclass TestDataAnnotationsQueryCtrl {\n annotation: any;\n constructor() {}\n static template = '<h2>Annotation scenario</h2>';\n}\n\nexport const plugin = new DataSourcePlugin(TestDataDataSource)\n .setConfigEditor(ConfigEditor)\n .setQueryEditor(QueryEditor)\n .setAnnotationQueryCtrl(TestDataAnnotationsQueryCtrl)\n .addConfigPage({\n title: 'Setup',\n icon: 'list-ul',\n body: TestInfoTab,\n id: 'setup',\n });\n"],"names":["ConfigEditor","PureComponent","render","streamingClientFields","label","id","placeholder","min","step","types","value","StreamingClientEditor","onChange","query","onInputChange","e","name","target","Number","InlineFieldRow","InlineField","labelWidth","Select","width","defaultValue","options","stream","type","map","Input","refId","grow","url","randomWalkFields","max","tooltip","testSelectors","selectors","RandomWalkEditor","selector","CSVContentEditor","onSaveCSV","csvContent","CodeEditor","height","language","onBlur","onSave","showMiniMap","showLineNumbers","CSVFileEditor","files","csvFileName","find","f","defaultPulseQuery","timeStep","onCount","onValue","offCount","offValue","defaultCSVWaveQuery","valuesCSV","defaultQuery","scenarioId","CSVWaveEditor","props","wave","last","index","onAdd","setValuesCSV","useState","labels","setLabels","setName","onValueChange","key","currentTarget","autoFocus","onKeyDown","evt","valueAsNumber","Button","icon","variant","onClick","undefined","CSVWavesEditor","waves","this","splice","push","length","ERROR_OPTIONS","errorType","v","liveTestDataChannels","description","GrafanaLiveEditor","channel","NodeGraphEditor","nodes","o","item","count","parseInt","fields","PredictablePulseEditor","pulseWave","RawFrameEditor","error","setError","warning","setWarning","onSaveFrames","rawFrameContent","json","JSON","parse","isArray","data","series","state","toDataFrameDTO","toDataFrame","toDataQueryResponse","dataFrameToJSON","console","log","stringify","Alert","title","severity","SimulationQueryEditor","ds","simQuery","sim","simKey","info","useAsync","async","getResource","sims","s","current","useMemo","details","option","config","path","tick","uid","onUpdateKey","isLoading","loading","InlineSwitch","Boolean","suffix","Label","Form","onSubmit","postResource","register","FieldSet","TextArea","rows","schema","USAQueryEditor","usaQueryModes","mode","ep","period","MultiSelect","fieldNames","vals","stateNames","states","getNextWord","Math","floor","random","words","defaultStreamQuery","speed","spread","noise","bands","runStream","req","defaults","Observable","subscriber","streamId","panelId","maxDataPoints","FieldType","alias","i","frame","StreamingDataFrame","maxLength","timeoutId","lastSent","addNextRow","time","values","event","Date","now","pushNextEvent","liveTimer","next","LoadingState","setTimeout","clearTimeout","runSignalStream","CircularDataFrame","append","capacity","addField","meta","preferredVisualisationType","add","line","getRandomLine","runLogsStream","reader","csv","CSVReader","callback","onHeader","field","onRow","row","processChunk","text","TextDecoder","decode","readCSV","done","complete","read","then","Error","fetch","Request","response","body","getReader","runFetchStream","showLabelsFor","endpoints","editorSelectors","TestInfoTab","constructor","super","LinkButton","href","rel","buildMetricTree","parent","depth","chars","children","letter","nodeName","queryTree","queryIndex","nodeQuery","result","namesToMatch","startsWith","replace","split","node","nameToMatch","indexOf","pattern","RegExp","test","concat","queryMetricTree","NodeGraphDataFrameFieldNames","links","internal","queryType","datasourceUid","datasourceName","displayName","unit","color","FieldColorModeId","fixedColor","edges","makeRandomNode","success","toString","subTitle","stat1","stat2","TestDataVariableSupport","StandardVariableSupport","toDataQuery","stringInput","csvWave","TestDataDataSource","DataSourceWithBackend","instanceSettings","templateSrv","getTemplateSrv","variables","backendQueries","streams","targets","hide","resolveTemplateVariables","scopedVars","runGrafanaLiveQuery","runGrafanaAPI","annotationDataTopicTest","variablesQuery","nodesQuery","rawFrameQuery","serverErrorQuery","points","point","backendOpts","of","merge","events","buildFakeAnnotationEvents","range","dataFrame","ArrayDataFrame","dataTopic","DataTopic","pipe","delay","timeWalker","from","valueOf","to","tags","annotationQuery","Promise","resolve","getQueryDisplayText","scenario","testDatasource","status","message","getScenarios","scenariosCache","items","getSearchFilterScopedVar","wildcardChar","frames","root","nodesWithoutMaxEdges","maxEdges","sourceIndex","source","additionalEdges","nodeFields","ArrayVector","nodeFrame","MutableDataFrame","Object","keys","edgeFields","edgesFrame","edgesSet","Set","mainStat","secondaryStat","arc__success","arc__errors","edge","has","generateRandomNodes","ex","throwError","getBackendSrv","get","res","liveQueryCounter","getGrafanaLiveSrv","getDataStream","addr","scope","LiveChannelScope","namespace","TestDataAnnotationsQueryCtrl","plugin","DataSourcePlugin","setConfigEditor","setQueryEditor","datasource","onRunQuery","scenarioList","hideAlias","hideAliasField","includes","onUpdate","currentScenario","newValue","checked","onFieldChange","onStreamClientChange","onPulseWaveChange","sort","a","b","localeCompare","showLabels","scenarioSelectContainer","inputId","sc","update","usa","lines","levelColumn","val","ErrorEditor","setAnnotationQueryCtrl","addConfigPage"],"sourceRoot":""}
|