Nadro/3799/perf (#4145)
* chore: building out perf testing * chore: adding my printing code for the different formats of the marks * feat: adding invocation count table * fix: markOnce iunstead * fix: typescript additions * fix: adding more types * chore: adding telemetry panel as MVP, gonna remove the pane * chore: view telemetry from command bar in file route and home route * fix: deleting unused imports * fix: deleting some unused files * fix: auto cleanup * chore: adding other routes, these will need to be moved... * chore: moving some printing logic around and unit testing some of it * fix: moving command init * fix: removing debugging marks * fix: adding some comments * fix: fixed a bug with generating the go to page commands * chore: adding will pages load within the router config * chore: implementing marks for routes * fix: auto fixes and checkers * chore: implemented a route watcher at the root level... * fix: auto fixes, removing unused code * chore: timing for syntax highlighting and auto fixes * fix: didAuth issue and syntax highlighting in the packaged application. Constructor name gets renamed * fix: fixing typescript checks * chore: adding mag bar chart icon for telemetry * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest) * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * chore: swapped telemetry icon for stopwatch * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest) * chore: writing telemetry to disk * fix: auto fixers * chore: getting args parsed for cli flags and writing telemetry file * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest) * chore: swapped mark for markOnce since we infinitely write marks to a JS array... need to solve this run time marking in another way. We only need this for startup right now * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest) * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * chore: writing raw marks to disk as well * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * fix: cleaned up the testing names * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest) * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest) * Fix fmt and codespell * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores) * fix: moving this route loader data stuff * chore: adding comment * fix: fmt * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores) * empty :( * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores) * empty :( --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: 49fl <ircsurfer33@gmail.com>
This commit is contained in:
@ -12,6 +12,8 @@ import {
|
||||
PROJECT_FOLDER,
|
||||
PROJECT_SETTINGS_FILE_NAME,
|
||||
SETTINGS_FILE_NAME,
|
||||
TELEMETRY_FILE_NAME,
|
||||
TELEMETRY_RAW_FILE_NAME,
|
||||
TOKEN_FILE_NAME,
|
||||
} from './constants'
|
||||
import { DeepPartial } from './types'
|
||||
@ -419,6 +421,34 @@ const getTokenFilePath = async () => {
|
||||
return window.electron.path.join(fullPath, TOKEN_FILE_NAME)
|
||||
}
|
||||
|
||||
const getTelemetryFilePath = async () => {
|
||||
const appConfig = await window.electron.getPath('appData')
|
||||
const fullPath = window.electron.path.join(appConfig, getAppFolderName())
|
||||
try {
|
||||
await window.electron.stat(fullPath)
|
||||
} catch (e) {
|
||||
// File/path doesn't exist
|
||||
if (e === 'ENOENT') {
|
||||
await window.electron.mkdir(fullPath, { recursive: true })
|
||||
}
|
||||
}
|
||||
return window.electron.path.join(fullPath, TELEMETRY_FILE_NAME)
|
||||
}
|
||||
|
||||
const getRawTelemetryFilePath = async () => {
|
||||
const appConfig = await window.electron.getPath('appData')
|
||||
const fullPath = window.electron.path.join(appConfig, getAppFolderName())
|
||||
try {
|
||||
await window.electron.stat(fullPath)
|
||||
} catch (e) {
|
||||
// File/path doesn't exist
|
||||
if (e === 'ENOENT') {
|
||||
await window.electron.mkdir(fullPath, { recursive: true })
|
||||
}
|
||||
}
|
||||
return window.electron.path.join(fullPath, TELEMETRY_RAW_FILE_NAME)
|
||||
}
|
||||
|
||||
const getProjectSettingsFilePath = async (projectPath: string) => {
|
||||
try {
|
||||
await window.electron.stat(projectPath)
|
||||
@ -552,6 +582,18 @@ export const writeTokenFile = async (token: string) => {
|
||||
return window.electron.writeFile(tokenFilePath, token)
|
||||
}
|
||||
|
||||
export const writeTelemetryFile = async (content: string) => {
|
||||
const telemetryFilePath = await getTelemetryFilePath()
|
||||
if (err(content)) return Promise.reject(content)
|
||||
return window.electron.writeFile(telemetryFilePath, content)
|
||||
}
|
||||
|
||||
export const writeRawTelemetryFile = async (content: string) => {
|
||||
const rawTelemetryFilePath = await getRawTelemetryFilePath()
|
||||
if (err(content)) return Promise.reject(content)
|
||||
return window.electron.writeFile(rawTelemetryFilePath, content)
|
||||
}
|
||||
|
||||
let appStateStore: Project | undefined = undefined
|
||||
|
||||
export const getState = async (): Promise<Project | undefined> => {
|
||||
|
Reference in New Issue
Block a user