Skip to content

Commit

Permalink
AT-1568 Implement "mode" for perf tests
Browse files Browse the repository at this point in the history
Add mode to sidebar
  • Loading branch information
MaXal committed Oct 15, 2024
1 parent 74554e3 commit ce19642
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ const {
branch = "master",
} = defineProps<PerformanceDashboardProps>()
provideReportUrlProvider(withInstaller, isBuildNumberExists)
const container = useTemplateRef<HTMLElement>("container")
const router = useRouter()
const sidebarVm = new InfoSidebarImpl()
Expand All @@ -87,6 +85,8 @@ provide(containerKey, container)
provide(sidebarVmKey, sidebarVm)
const serverConfigurator = new ServerWithCompressConfigurator(dbName, table)
provideReportUrlProvider(withInstaller, isBuildNumberExists)
provide(serverConfiguratorKey, serverConfigurator)
const persistenceForDashboard = new PersistentStateManager(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ enum TestMetricSwitcher {
Metrics = "Metrics",
}
provideReportUrlProvider(withInstaller)
const container = useTemplateRef<HTMLElement>("container")
const router = useRouter()
const sidebarVm = new InfoSidebarImpl()
Expand All @@ -190,6 +188,8 @@ provide(containerKey, container)
provide(sidebarVmKey, sidebarVm)
const serverConfigurator = new ServerWithCompressConfigurator(dbName, table)
provideReportUrlProvider(withInstaller)
provide(serverConfiguratorKey, serverConfigurator)
const persistentStateManager = new PersistentStateManager(
`${dbName}-${table}-dashboard`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { provide } from "vue"
import { reportInfoProviderKey } from "../../shared/injectionKeys"
import { dbTypeStore } from "../../shared/dbTypes"

/**
* If you change this method, you should adjust:
* getInfoDataFrom in dashboard/new-dashboard/src/components/common/sideBar/InfoSidebarPerformance.ts
* configureChart in dashboard/new-dashboard/src/configurators/MeasureConfigurator.ts:306
*/
export function provideReportUrlProvider(isInstallerExists: boolean = true, isBuildNumberExists: boolean = false): void {
console.log("provideReportUrlProvider")
const infoFields = ["machine", "tc_build_id", "project"]
if (isInstallerExists) {
infoFields.push("tc_installer_build_id", "build_c1", "build_c2", "build_c3")
Expand All @@ -15,6 +17,10 @@ export function provideReportUrlProvider(isInstallerExists: boolean = true, isBu
infoFields.push("build_number")
}
infoFields.push("branch")
console.log(dbTypeStore().isModeSupported())
if (dbTypeStore().isModeSupported()) {
infoFields.push("mode")
}
provide(reportInfoProviderKey, {
infoFields,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface InfoData {
chartDataUrl: string
buildIdPrevious: number | undefined
buildIdNext: number | undefined
mode: string | undefined
}

class Description {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@
</div>
</div>

<span
v-if="data?.mode"
class="flex gap-1.5 items-center"
>
<AdjustmentsVerticalIcon class="w-4 h-4" />
{{ data?.mode }}
</span>

<span
v-if="data?.deltaPrevious"
class="flex gap-1.5 items-center"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,26 @@ function getInfo(params: CallbackDataParams, valueUnit: ValueUnit, accidents: Re
let installerId: number | undefined
let type: ValueUnit | undefined = valueUnit
let branch: string | undefined
let mode: string | undefined
const dbType = dbTypeStore().dbType
if (dbType == DBType.INTELLIJ_DEV || dbType == DBType.PERF_UNIT_TESTS || dbType == DBType.FLEET_PERF) {
if (dbType == DBType.FLEET_PERF) {
metricName = dataSeries[2] as string
if (dataSeries[3] == "c") {
type = "counter"
}
machineName = dataSeries[4] as string
projectName = dataSeries[6] as string
branch = dataSeries[7] as string
}
if (dbType == DBType.INTELLIJ_DEV || dbType == DBType.PERF_UNIT_TESTS) {
metricName = dataSeries[2] as string
if (dataSeries[3] == "c") {
type = "counter"
}
machineName = dataSeries[4] as string
projectName = dataSeries[6] as string
branch = dataSeries[7] as string
mode = dataSeries[8] as string
}
if (dbType == DBType.FLEET || dbType == DBType.STARTUP_TESTS) {
metricName = dataSeries[2] as string
Expand Down Expand Up @@ -162,6 +173,7 @@ function getInfo(params: CallbackDataParams, valueUnit: ValueUnit, accidents: Re
projectName = dataSeries[6] as string
installerId = dataSeries[7] as number
branch = dataSeries[11] as string
mode = dataSeries[12] as string
}
if (dbType == DBType.BAZEL) {
metricName = dataSeries[2] as string
Expand Down Expand Up @@ -214,6 +226,7 @@ function getInfo(params: CallbackDataParams, valueUnit: ValueUnit, accidents: Re
branch,
metricName,
type,
mode,
}
}

Expand Down

0 comments on commit ce19642

Please sign in to comment.