Skip to content

Commit 095da26

Browse files
authored
feat: changed aggregate text and add bucket logic (#5226)
1 parent 9454342 commit 095da26

File tree

4 files changed

+20
-19
lines changed

4 files changed

+20
-19
lines changed

src/homepageExperience/components/steps/cli/ExecuteAggregateQuery.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import CodeSnippet from 'src/shared/components/CodeSnippet'
33

44
import {SafeBlankLink} from 'src/utils/SafeBlankLink'
55
import {event} from 'src/cloud/utils/reporting'
6+
import {DEFAULT_BUCKET} from 'src/writeData/components/WriteDataDetailsContext'
67

78
const logCopyCodeSnippet = () => {
89
event('firstMile.cliWizard.executeAggregateQuery.code.copied')
@@ -18,27 +19,27 @@ type OwnProps = {
1819

1920
export const ExecuteAggregateQuery = (props: OwnProps) => {
2021
const {bucket} = props
21-
22+
const bucketName = bucket === DEFAULT_BUCKET ? 'sample-bucket' : bucket
2223
const fromBucketSnippet = `from(bucket: "weather-data")
2324
|> range(start: -10m)
2425
|> filter(fn: (r) => r.measurement == "temperature")
2526
|> mean()`
2627

27-
const codeSnippet = `influx query 'from(bucket:"${bucket}") |> range(start:-10m) |> mean()' --raw`
28+
const codeSnippet = `influx query 'from(bucket:"${bucketName}") |> range(start:-10m) |> mean()' --raw`
2829

2930
return (
3031
<>
3132
<h1>Execute a Flux Aggregate Query</h1>
3233
<p>
33-
An{' '}
3434
<SafeBlankLink
3535
href="https://docs.influxdata.com/flux/v0.x/function-types/#aggregates"
3636
onClick={logDocsOpened}
3737
>
38-
aggregate
38+
Aggregate functions
3939
</SafeBlankLink>{' '}
40-
function is a powerful method for returning combined, summarized data
41-
about a set of time-series data.
40+
take the values of all rows in a table and use them to perform an
41+
aggregate operation. The result is output as a new value in a single-row
42+
table.
4243
</p>
4344
<p>
4445
An aggregation is applied after the time range and filters, as seen in
@@ -57,7 +58,7 @@ export const ExecuteAggregateQuery = (props: OwnProps) => {
5758
language="properties"
5859
/>
5960
<p style={{marginTop: '20px'}}>
60-
This will return the mean of the insect counts from the census data.
61+
This will return the mean of the sample data.
6162
</p>
6263
</>
6364
)

src/homepageExperience/components/steps/go/ExecuteAggregateQuery.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ if err := results.Err(); err != nil {
4242
<>
4343
<h1>Execute an Aggregate Query</h1>
4444
<p>
45-
An{' '}
4645
<SafeBlankLink
4746
href="https://docs.influxdata.com/flux/v0.x/function-types/#aggregates"
4847
onClick={logDocsOpened}
4948
>
50-
aggregate
49+
Aggregate functions
5150
</SafeBlankLink>{' '}
52-
function is a powerful method for returning combined, summarized data
53-
about a set of time-series data.
51+
take the values of all rows in a table and use them to perform an
52+
aggregate operation. The result is output as a new value in a single-row
53+
table.
5454
</p>
5555
<CodeSnippet
5656
text={fromBucketSnippet}

src/homepageExperience/components/steps/nodejs/ExecuteAggregateQuery.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ queryClient.queryRows(fluxQuery, {
4646
<>
4747
<h1>Execute an Aggregate Query</h1>
4848
<p>
49-
An{' '}
5049
<SafeBlankLink
5150
href="https://docs.influxdata.com/flux/v0.x/function-types/#aggregates"
5251
onClick={logDocsOpened}
5352
>
54-
aggregate
53+
Aggregate functions
5554
</SafeBlankLink>{' '}
56-
function is a powerful method for returning combined, summarized data
57-
about a set of time-series data.
55+
take the values of all rows in a table and use them to perform an
56+
aggregate operation. The result is output as a new value in a single-row
57+
table.
5858
</p>
5959
<CodeSnippet
6060
text={fromBucketSnippet}

src/homepageExperience/components/steps/python/ExecuteAggregateQuery.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ for table in tables:
4343
<>
4444
<h1>Execute an Aggregate Query</h1>
4545
<p>
46-
An{' '}
4746
<SafeBlankLink
4847
href="https://docs.influxdata.com/flux/v0.x/function-types/#aggregates"
4948
onClick={logDocsOpened}
5049
>
51-
aggregate
50+
Aggregate functions
5251
</SafeBlankLink>{' '}
53-
function is a powerful method for returning combined, summarized data
54-
about a set of time-series data.
52+
take the values of all rows in a table and use them to perform an
53+
aggregate operation. The result is output as a new value in a single-row
54+
table.
5555
</p>
5656
<CodeSnippet
5757
text={fromBucketSnippet}

0 commit comments

Comments
 (0)