Lighthouse Capture Script Load Time - lighthouse

What is the best way to capture the load time of a specific script using lighthouse?
Are there example gatherers that do this?
Thanks

Related

Playwright's performance in capturing events on chrome pages is not stable enough. Is there a good solution?

We sent some click events to Google Analytics on the web page. We wanted to use Playwright to test these events automatically but found that these events could not be captured well in the code. I have used some methods, such as 'expect', 'page wait for locator', and some 'wait for time out', but the effect is still not good enough. Is there a better way to help solve this problem?
I want to know what is the cause, just because the program runs too fast?

Is it possible to do image comparison using UIAutomation?

I have to verify whether one label in the app matches the referenced image or not.
So please tell me how it can be done using UIAutomation.
Thanks in advance.
Your only hope using just the xCode Instruments software is to use the UIAHost.performTaskWithPathArgumentsTimeout function. You'll have to send the screenshot (which you can take inside of the Instruments software) to an image processing script that you've written and have saved in some accessible location and then return the result. If you use a large enough timeout you won't want to worry about the script moving on before getting the result back from your outside script.
I think, but am entirely unsure, that there are third party automation softwares that include image processing stuffs.

What is the best way to make a Windows service ask the user for input?

I'm trying to write a program to ask me to input some information periodically, so I've written a service in C to run in the background, I can watch it reporting its okay by refreshing its log file. Now I'm stuck on how to get it to open up cmd and ask for the information.
I'd like to save this information to a log file. (I'm planning on monitoring my sleeping habits)
I tried using system("getinput.exe") and that seems to do nothing, I know using system() is bad but it was a first step.
CreateProcess() I simply cannot get to work, the example on MSDN http://msdn.microsoft.com/en-us/library/ms682512.aspx doesn't work for me, i just get CreateProcess failed (2) whenever i try createprocess.exe dir for example.
Surely there must be a way?
EDIT: Thanks for the replies I will try to take a different approach then. Where would I start with writing a background application that can occasionally ask for user input in C?

XNA Content Loading

Anybody know how i can stream load Model data in XNA 4 Content Loader ?
And not have to specify a farken filename ...
Was hoping somehow get a stream running as the model data resides on a db.
And no, im not interested in temp files :p
Regards
If you really want to use the Content Pipeline for this, you can subclass ContentManager and override OpenStream. This would assume that the built XNB files reside in the database and you can provide the stream to them when requested :)
Content.Load<Model>() requires a string parameter, so I don't think that you'll be able to stream a Model in. I should mention that the string parameter that is required is a filePath, so you wouldn't be able to convert a stream to a string and pass that in.
I believe that this should help. If I remember correctly, I can't check because I'm at work, it lets you run the content importer on a stream dynamically. So you should be able to dump your file in a MemeoryStream and load it so long as its any of the file types XNA supports.
Be warned though this is pretty slow because you have to compile every file when you load it.
Curious of why you need to load from a database. I assume its from a remote server? In which case the download time + compile time might be a bit much. since it sounds like you would have to do it every time the game is loaded.
http://create.msdn.com/en-US/education/catalog/sample/winforms_series_2

ColdFusion: CFEXECUTE/FFMPEG Memory Issue?

So my application allows for users to upload video, convert it using FFMPEG and then transfer it over to the Flash Media Server. Lately, I've run into an issue.
If ever there is an error when converting video, I automatically generate cfcatch report PDF. This time I came across a "Cannot allocate memory" error. This massively concerns me because I'm about to promote my system out and I can't afford for the scripts to stop running within the first few hours.
Is there a way to clean up the memory issues with ColdFusion? I mean, once the job has been done, can I essentially "reset" the memory that the server was using?
If you understand the potential disaster, I'm sure you'll understand why I've got to find out how to make sure my scripts are executing properly. The physical fix is to restart the server, but I obviously cannot be restarting the server every single time a user uploads a video...
Great answer but I couldn't get your script to work so re-touched and what a difference!!!
<cfloop collection="#REQUEST#" item="mydex">
<cfset StructDelete(REQUEST, "#mydex#", "True")>
</cfloop>
<cfloop collection="#VARIABLES#" item="mydex">
<cfset StructDelete(VARIABLES, "#mydex#", "True")>
</cfloop>
I remember reading that some server versions don't properly dispose of COM objects and the like when a page request is finished. If any of this is being done via a CFC or Java class that's being set to a variable, you can put this in OnRequestEnd.cfm:
<cfset StructDelete(variables)>
<cfset StructDelete(request)>
This will get rid of any variables set on the page which are no longer needed. Shouldn't have any negative side effects, and should clear up any memory that might be still lurking in one of the variables set during the processing of that page.
You might also look into using something other than <cfexecute> to process the videos. Maybe have a background process that routinely checks a folder for videos and then converts them in the background? ColdFusion isn't necessarily efficient when it comes to batch processing.
I have come across some instances where it's helpful to actually manually run JVM garbage collection from within CF, usually when there is a long running thread doing long-term queue management and the request is very long running.
It might be worth a shot in your case.
To run the garbage collector from within CF you call the following:
<cfset runtime = CreateObject("java", "java.lang.Runtime").getRuntime()>
<cfset runtime.gc()>
Hope it helps!
If you are on windows, I recommend calling a batch file to do the conversion and file transfer. You can execute the Batch file from CF. This will prevent CF from consuming the entire memory for the conversion and the task can continue running in the background. If you want to wait to get the status, add a "timer" using a CF Java object instantiation to check the status after X seconds.
or you can call a cmd window to run it - http://www.forta.com/blog/index.cfm/2006/7/31/Using-CFEXECUTE-To-Execute-Command-Line-Utilities
I don't understand why in the world you're trying to reinvent the wheel when I wrote a DSL wrapper for FFMPEG with the fix for the memory leak included in it:
https://github.com/rip747/cfffmpeg
Fork and submit any enhancements or fixes that you'd like.
BTW, if you want to see how to really handle the memory issues that you are having, then read the article by CFSEARCHING:
http://cfsearching.blogspot.com/2007/12/using-ffmpeg-to-convert-video-files-to.html
Again, this approach is included in the DSL.

Resources