How could I find slices' "cpu self time" and "self time" in perfetto UI results like the legacy UI for systrace do? - cpu

I'm using perfetto to trace my app. I am not using systrace because I need to trace for long duration. However in the perfetto result below, I can only find slices' "wall duration" not the "self duration" and "cpu self duration" which can be found in legacy UI for systrace. I'm sure these two "self" duration's infomation is in the perfetto file, because when I press the "swtich to legacy UI" button, the corresponding legacy UI does show them. However I cannot use the legacy UI directly, for it could only show about 10s trace info of my applications. So how can I find these "self" duration infomation in the perfetto UI, really thanks for any idea.
perfetto result
related legacy ui result

You're almost there - see this annotated screenshot
All you need to do is go to the "Thread states" tab (annotated 1) in the bottom sheet, and look at the "Running" (annotated 2) "Wall Duration" value (annotated 3).

Related

SAP Script Recording and Playback - Cumulative data

If I am using the Script Recording and Playback feature on same transaction for instance ME25, multiple times, I am getting cumulative data as part of multiple scripts rather than incremental data.
Explanation :
If I open ME25 details and enter "100-310" as Material and "Ball Bearing" as Short Text and stop the recording, I get the following script, which is expected behavior.
session.findById("wnd[0]/usr/tblSAPMM06BTC_0106/ctxtEBAN-MATNR[3,0]").text = "100-310"
session.findById("wnd[0]/usr/tblSAPMM06BTC_0106/txtEBAN-TXZ01[4,0]").text = "Ball Bearing"
session.findById("wnd[0]/usr/tblSAPMM06BTC_0106/txtEBAN-TXZ01[4,0]").setFocus
session.findById("wnd[0]/usr/tblSAPMM06BTC_0106/txtEBAN-TXZ01[4,0]").caretPosition = 12
After this, I restart the recording and type Qty Requested as "100" and delivery date as "21.04.2021" and stop the recording. I get the following script:
session.findById("wnd[0]").maximize
session.findById("wnd[0]/usr/tblSAPMM06BTC_0106/ctxtEBAN-MATNR[3,0]").text = "100-310"
session.findById("wnd[0]/usr/tblSAPMM06BTC_0106/txtEBAN-TXZ01[4,0]").text = "Ball Bearing"
session.findById("wnd[0]/usr/tblSAPMM06BTC_0106/txtEBAN-MENGE[5,0]").text = "100"
session.findById("wnd[0]/usr/tblSAPMM06BTC_0106/ctxtRM06B-EEIND[8,0]").text = "21.04.2021"
session.findById("wnd[0]/usr/tblSAPMM06BTC_0106/ctxtEBAN-EKGRP[9,0]").setFocus
session.findById("wnd[0]/usr/tblSAPMM06BTC_0106/ctxtEBAN-EKGRP[9,0]").caretPosition = 0
Instead of getting the incremental part that I typed for the second recording instance, I am getting complete script. Is there a way to achieve incremental scripts?
I can reproduce in my SAP GUI 7.60 (whatever screen it is; whatever kind of field it is, I can reproduce even with very simple fields like in a Selection Screen).
It seems that it happens all the time, even if you write your own recorder (a VBS script which mainly uses session.record = True + event handlers). It's due to the fact that SAP GUI sends all the screen events (i.e. the user actions) since the screen was entered, when the user presses a button, a function key, closes a window, or stops the SAP GUI Recorder.
If you write your own recorder, I guess you can save the screen contents when you start the recorder, and when the "change" events occur you may ignore those ones where the new field value has not changed since the recorder started. But that's a lot of work.
I think that it's far more easy to append manually the last lines of the last script to the initial script.

Testing a long process in Xamarin Test Cloud

I have a question about Xamarin Test Cloud, hope someone can point me in the right direction.
When a user taps a button in my app, a process runs for around 30 minutes. I added a Unit Test project and it runs perfectly in the emulator.
However, I need to test it in real devices, so I decided to use Xamarin Test Cloud. When I run the test there, it doesn't complete it. As I said, it should take 30 minutes but the test finishes almost immediately.
Here is the code of my Test:
[Test]
[Timeout(Int32.MaxValue)]
public async void Optimize()
{
await Task.Run(async() =>
{
app.Screenshot("Start " + DateTime.Now);
app.Tap(x => x.Marked("btnOptimize"));
await Task.Delay(120000);
app.Screenshot("End " + DateTime.Now);
}
}
If I run the test in the emulator, the screenshot names are (for instance) "Start 12:00:00" and "End 12:30:00" respectively (so it means that it runs for 30 minutes, as expected). However, in Test Cloud I get (for instance) "Start 12:00:00" and "End 12:02:00", which means that the test runs for only 2 minutes. But that's because I added the delay. Without the delay, it will run for only 5 seconds.
Is that what I need? I can add 1800000 so the test can be completed in 30 minutes, but what if I don't know the time?
Thank you and sorry if it's a basic question
Something like this should do the job:
[Test]
public async void Optimize()
{
app.Screenshot("Start");
app.Tap("btnOptimize");
app.WaitForElement ("otherButton", "Timed out waiting for Button", new TimeSpan(0,30,0));
app.Screenshot("End");
}
Where "otherButton" becomes visible when the task is done. There are other Wait methods available in the API.
But, note that the Xamarin Test Cloud has a thirty minute maximum per test by default. That default can be modified by contacting Xamarin Test Cloud support.
Also, it is not a good practice to include non-deterministic information or any information that may vary per device or run in your screen shot titles. When you run on more than one device the test report steps and screenshots are collated partially by the screen shot titles so they should match across devices for best results.
While I have never tried a timeout length of 30 minutes, the Calabash allows you to wait for a condition using wait_for):
The following snippet is an example of how to use wait_for to detect the presence of a button on the screen:
wait_for(timeout: 60, timeout_message: "Could not find 'Sign in' button") do
element_exists("button marked:'Sign in'")
end
Ref: https://docs.xamarin.com/guides/testcloud/calabash/working-with/timeouts/
Just an FYI: 30 minutes is a really long time for a mobile device to be "background processing" without user interface interaction, if you are targeting iOS/Apple Store, this death sentence in getting Apple submission approval as they will never wait that long for an app to process something....
You need to identify tap by Id and add WaitForElement(first argument is query you want to wait on) in correct syntax like given below. It should work for you.
app.Screenshot("Start " + DateTime.Now);
app.WaitForElement(x => x.Id("btnOptimize"),"Optimization timed out",new System.TimeSpan(0,30,0),null,null);
app.Tap(x => x.Id("btnOptimize"));
app.Screenshot("End " + DateTime.Now);

using REST, how does one set the fan duration for a one-time action?

three fan-related variables are defined in https://developer.nest.com/documentation/api#has_fan
has_fan (r/o, boolean)
fan_timer_active (r/w, boolean)
fan_timer_timeout (r/o, iso8601)
i suspect that fan_timer_timeout should be read-write; however, when i PUT
{"fan_timer_active": true, "fan_timer_timeout": "2014-09-30T01:07:29Z"}
i get back
No write permission(s) for field(s): fan_timer_timeout
none of the examples (on the SDK site) actually change the fan, so no guidance there.
the "non-public API" from "the early days" would have you do this:
fan_timer_duration = seconds
fan_timer_timeout = time-since-epoch-in-seconds + seconds
fan_timer_timeout isn't documented on the SDK site; however, doing that yields
No write permission(s) for field(s): fan_timer_duration,fan_timer_timeout
could someone clue me in as to what i need to send to get the fan to spin for the next 15 minutes?
many thanks!
The user configures the fan time duration in the Nest app or on the device, the API only provides a way to trigger a fan event.
It seems that fan time duration is a global setting, and would affect turning on the fan manually at the thermostat, hence why it is read only in the API. (Avoids user confusion)

Ruby/Selenium WebDriver - Pausing test and waiting for user input, i.e. user inputs captcha

I'm using the Selenium WebDriver and Ruby to perform some automation and I ran into a problem of a captcha around step 3 of a 5 step process.
I'm throwing all the automation in a rake script so I'm wondering is there a command to pause or break the script running temporarily until I enter data into the captcha and then continue running on the next page.
To build on seleniumnewbie's answer and assuming that you have access to the console the script is running on:
print "Enter Captcha"
captchaTxt = gets.chomp
yourCaptchaInputWebdriverElement.send_keys captchaTxt
If you just want to pause and enter the captcha in your browser, you can just have it prompt at the console to do that very thing and it'll just sit there.
print "Enter the captcha in your browser"
gets
You could also set the implicit wait to decently long period of time so that Selenium would automatically see the next page and move out. However, this would leave the important Captcha step (for documenting / processes sake) out of your test unless you're pretty anal with your commenting.
Since this is an actively participating test requiring user input I would say that making the tester press "enter" on the console is the way to go.
Since you are writing the test in a script, all you need to do is add a sleep in your test i.e. 'sleep 100' for example.
However, it is bad to add arbitrary sleeps in tests. You can also do something like "Wait for title 'foo'" where 'foo' is the title of the page in Step 4. It need not be title, it can be anything, but you get the idea. Wait for something semantic which indicates that step 3 is done and step 4 is ready to start.
This way, its more targeted wait.
This has been implemented in JAVA, but similar technique.Your solution could be found here

MVC Mini Profiler "duration" vs "with children"

I really like the tool, but I haven't been able to find any guidelines to help with interpreting the results of the mini profiler. I seem to get one expandable tab per action method, and I can plainly figure out the durations of my manually-created profiler steps, but I cannot intuitively (or with the help of google) figure out the difference between "duration" and "with children." Typing this question I have come up with a guess: Does "duration" mean "excluding children?"
Duration is the executing time of that monitored code minus any reported children. The MVC Mini Profiler uses a hierarchy to track timings of different paths of code. That hierarchy is not created based on functions but on how you log the calls.
Here is a sample example from a project. There is a page which calls "ListService", which executes "getList", then "FilListWithOptions", and so on.
http://www.temppage.com:80/something.aspx
ListService
getList
FillListWithOptions
QtyBreakPrices
FillProductDataWithOptions
GetProducts
ProductService
These don't have to be individual functions, just nested code that's wrapped in the monitoring code:
using (profiler.Step("ListService"))
{
using (profiler.Step("getList"))
{ // something more interesting here
}
using (profiler.Step("FillListWithOptions"))
{ // and here
}
}
using (profiler.Step("ProductService"))
{
// blah
}
The duration of http://www.temppage.com:80/something.aspx might be 615.2ms, with children is 2222.5ms.
Duration of "ListService" is 3ms, with children is 807ms.
So from those stats we can determine that you are correct; duration is only the code executed, excluding reported children. With children combines duration and childrens time to get a total.
But "ProductService" doesn't have any reported children and it's duration and with children are the same at 400ms. I know the ProductService does call other functions which call other functions. The profiler doesn't count those as children because it doesn't know about them. It reports the same for both unless you wrap them with the using statements.

Resources