cancel
Showing results for 
Search instead for 
Did you mean: 

Advanced Capstone 2.5

anduhau
New Contributor II

Hello! Could anyone provide, please, some advice on how to proceed with exercise 2.5? Should I go on Scratchpad and press Profile as in the picture shown here? Moreover, am I doing this in order to see the code behind the function?

4 REPLIES 4

Laura
Community Manager Community Manager
Community Manager

Hi @anduhau , 

Yes, exactly. Right click and click on profile as described in the question.

This will take you to the visual profiler where you can execute the function to see where the "bottleneck" is. It will show how long each part of the function takes, and your task is to update the code and and improve the time the function takes to run. 

Thanks,

Laura

anduhau
New Contributor II

Alright!

I see this database about the function. However, I do not what that function does, or how I could access the code inside the function from here (screenshot attached).

Laura
Community Manager Community Manager
Community Manager

@anduhau ,

The profiler just tells you where the most time and memory in the function is being spent.

Your task is to work out what each part of the function is doing and update the code within to improve upon the time while ensuring the function still works as designed. 

You can view the code back in Developer, by either executing the function name with no square brackets e.g. 

.viz.createDashboard

 or on the left hand side of Developer in your workspace tree, under AdvancedCapstone.Visualization

Hope this helps,

Laura

anduhau
New Contributor II

Dear Laura,

Thank you for letting me know! I made some changes and the function worked initially. However, after I saved the changes, closed and opened the workspace again, it showed me again that the execution speed was not high enough. 

I have performed the following changes in the main file:

// your code here or work in scratchpad
system"l ",getenv[`AX_WORKSPACE],"/AdvancedCapstone.Setup/dbmaint.q"
setattrcol[`:.;`sensor;`lapId;`g]
setattrcol[`:.;`sensor;`sensorId;`p] 

 I have changed the code in the .viz.getModSensor as well:

select from sensor where date in 2020.01.01 2020.01.02, sensorId in symbols, 0=lapId mod 2