Skip to content

Commit

Permalink
updates to index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
twitchyvr committed Nov 21, 2023
1 parent ec54e6f commit df6ce79
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 23 deletions.
18 changes: 18 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"configurations": [
{
"name": "macos-clang-arm64",
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "/usr/bin/clang",
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "macos-clang-arm64",
"compilerArgs": [
""
]
}
],
"version": 4
}
32 changes: 20 additions & 12 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Node Functions",
"type": "node",
"request": "attach",
"port": 9229,
"preLaunchTask": "func: host start",
"runtimeExecutable": "${env:HOME}/.nvm/versions/node/v10.24.1/bin/node"
}
]
}
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Node Functions",
"type": "node",
"request": "attach",
"port": 9229,
"preLaunchTask": "func: host start",
"runtimeExecutable": "${env:HOME}/.nvm/versions/node/v10.24.1/bin/node"
},
{
"name": "C/C++ Runner: Debug Session",
"type": "lldb",
"request": "launch",
"args": [],
"cwd": "/Users/mattrogers/Downloads",
"program": "/Users/mattrogers/Downloads/build/Debug/outDebug"
}
]
}
69 changes: 63 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,65 @@
{
"azureFunctions.deploySubpath": ".",
"azureFunctions.postDeployTask": "npm install (functions)",
"azureFunctions.projectLanguage": "JavaScript",
"azureFunctions.projectRuntime": "~2",
"debug.internalConsoleOptions": "neverOpen",
"azureFunctions.preDeployTask": "npm prune (functions)"
"azureFunctions.deploySubpath": ".",
"azureFunctions.postDeployTask": "npm install (functions)",
"azureFunctions.projectLanguage": "JavaScript",
"azureFunctions.projectRuntime": "~2",
"debug.internalConsoleOptions": "neverOpen",
"azureFunctions.preDeployTask": "npm prune (functions)",
"C_Cpp_Runner.cCompilerPath": "clang",
"C_Cpp_Runner.cppCompilerPath": "clang++",
"C_Cpp_Runner.debuggerPath": "lldb",
"C_Cpp_Runner.cStandard": "",
"C_Cpp_Runner.cppStandard": "",
"C_Cpp_Runner.msvcBatchPath": "",
"C_Cpp_Runner.useMsvc": false,
"C_Cpp_Runner.warnings": [
"-Wall",
"-Wextra",
"-Wpedantic",
"-Wshadow",
"-Wformat=2",
"-Wcast-align",
"-Wconversion",
"-Wsign-conversion",
"-Wnull-dereference"
],
"C_Cpp_Runner.msvcWarnings": [
"/W4",
"/permissive-",
"/w14242",
"/w14287",
"/w14296",
"/w14311",
"/w14826",
"/w44062",
"/w44242",
"/w14905",
"/w14906",
"/w14263",
"/w44265",
"/w14928"
],
"C_Cpp_Runner.enableWarnings": true,
"C_Cpp_Runner.warningsAsError": false,
"C_Cpp_Runner.compilerArgs": [],
"C_Cpp_Runner.linkerArgs": [],
"C_Cpp_Runner.includePaths": [],
"C_Cpp_Runner.includeSearch": [
"*",
"**/*"
],
"C_Cpp_Runner.excludeSearch": [
"**/build",
"**/build/**",
"**/.*",
"**/.*/**",
"**/.vscode",
"**/.vscode/**"
],
"C_Cpp_Runner.useAddressSanitizer": false,
"C_Cpp_Runner.useUndefinedSanitizer": false,
"C_Cpp_Runner.useLeakSanitizer": false,
"C_Cpp_Runner.showCompilationTime": false,
"C_Cpp_Runner.useLinkTimeOptimization": false,
"C_Cpp_Runner.msvcSecureNoWarnings": false
}
9 changes: 4 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ module.exports = async function (context, req) {

// Try to process telemetry
try {
// const telemetry = new Telemetry(rawData)
// const telemetry = await Telemetry.fromFile(rawData) // Adjust this line based on how your file loader works
const telemetry = await Telemetry.fromBuffer(rawData);
const telemetry = await Telemetry.fromBuffer(rawData)
const telemetrySummary = {
uniqueId: telemetry.uniqueId(),
header: telemetry.headers,
Expand All @@ -26,7 +24,8 @@ module.exports = async function (context, req) {
sampleCount: telemetry.sampleCount(),
duration: telemetry.duration(),
laps: telemetry.laps(),
variables: telemetry.variables()
variables: telemetry.variables(),
telemetry: telemetry.samples()
}

context.res = {
Expand All @@ -40,7 +39,7 @@ module.exports = async function (context, req) {
} catch (error) {
context.res = {
status: 500,
body: `Error: ${error.message} \r\nStack: ${error.stack}\r\nRawBody: ${rawData}`
body: `Error: ${error.message} \r\nStack: ${error.stack}\r\nRaw Data: ${rawData}`
}
context.log.error('Function execution error:', error)
}
Expand Down

0 comments on commit df6ce79

Please sign in to comment.