You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by jude <fl...@gmail.com> on 2015/12/10 23:23:11 UTC

Is there a API for CPU usage of an app?

Is there a API for checking the CPU usage of my AIR app (or Flex)? It's
been suggested to check the FPS and see if they drop but that's not what
I'm looking for.

Background:
I was sitting with someone who was using an app I wrote and it was going
really slow. It was not a brand new computer. But I wanted to know if it
was my app. Because the laptop was in front of me I could open Task Manager
(PC) or Activity Monitor (Mac) and check but I'm not always going to have
that convenience. So if I'm able to check periodically my app CPU usage and
it is hitting 100% or more than a threshold I can, from within the app,
check what process is going on or what the activity the user is doing.

Re: Is there a API for CPU usage of an app?

Posted by Alex Harui <ah...@adobe.com>.
Did you try turning on the telemetry flag in the SWF to see if that
enables that API?

FWIW, if you are writing an AIR app, I suppose you could create a
NativeExtension?

-Alex

On 12/10/15, 6:40 PM, "jude" <fl...@gmail.com> wrote:

>Scout is more for developers when you have access to the running instance.
>I'm looking for something the customer can use at runtime on a non debug
>instance.
>
>I found this mysterious property while I was looking for memory usage in
>flash.system.System:
>
>flash.system.System.processCPUUsage();
>
>But I can't find any documentation on it and it returns 0. I think I can
>write a pretty efficient app but zero CPU is just wishful thinking.
>
>
>
>On Thu, Dec 10, 2015 at 5:46 PM, Jason Taylor <ja...@dedoose.com> wrote:
>
>> isn't that what Scout is for?  turn on advanced telemetry and pop open
>> adobe scout
>>
>> -----Original Message-----
>> From: Alex Harui [mailto:aharui@adobe.com]
>> Sent: Thursday, December 10, 2015 3:49 PM
>> To: dev@flex.apache.org
>> Subject: Re: Is there a API for CPU usage of an app?
>>
>> I don't know of any way to get that from Flash.
>>
>> On 12/10/15, 2:23 PM, "jude" <fl...@gmail.com> wrote:
>>
>> >Is there a API for checking the CPU usage of my AIR app (or Flex)? It's
>> >been suggested to check the FPS and see if they drop but that's not
>> >what I'm looking for.
>> >
>> >Background:
>> >I was sitting with someone who was using an app I wrote and it was
>> >going really slow. It was not a brand new computer. But I wanted to
>> >know if it was my app. Because the laptop was in front of me I could
>> >open Task Manager
>> >(PC) or Activity Monitor (Mac) and check but I'm not always going to
>> >have that convenience. So if I'm able to check periodically my app CPU
>> >usage and it is hitting 100% or more than a threshold I can, from
>> >within the app, check what process is going on or what the activity the
>> >user is doing.
>>
>>


RE: Is there a API for CPU usage of an app?

Posted by Jason Taylor <ja...@dedoose.com>.
you don't need to run in debug mode to use advanced telemetry and/or scout, you just need to compile with that turned on.

-----Original Message-----
From: jude [mailto:flexcapacitor@gmail.com] 
Sent: Thursday, December 10, 2015 6:41 PM
To: dev
Subject: Re: Is there a API for CPU usage of an app?

Scout is more for developers when you have access to the running instance.
I'm looking for something the customer can use at runtime on a non debug instance.

I found this mysterious property while I was looking for memory usage in
flash.system.System:

flash.system.System.processCPUUsage();

But I can't find any documentation on it and it returns 0. I think I can write a pretty efficient app but zero CPU is just wishful thinking.



On Thu, Dec 10, 2015 at 5:46 PM, Jason Taylor <ja...@dedoose.com> wrote:

> isn't that what Scout is for?  turn on advanced telemetry and pop open 
> adobe scout
>
> -----Original Message-----
> From: Alex Harui [mailto:aharui@adobe.com]
> Sent: Thursday, December 10, 2015 3:49 PM
> To: dev@flex.apache.org
> Subject: Re: Is there a API for CPU usage of an app?
>
> I don't know of any way to get that from Flash.
>
> On 12/10/15, 2:23 PM, "jude" <fl...@gmail.com> wrote:
>
> >Is there a API for checking the CPU usage of my AIR app (or Flex)? 
> >It's been suggested to check the FPS and see if they drop but that's 
> >not what I'm looking for.
> >
> >Background:
> >I was sitting with someone who was using an app I wrote and it was 
> >going really slow. It was not a brand new computer. But I wanted to 
> >know if it was my app. Because the laptop was in front of me I could 
> >open Task Manager
> >(PC) or Activity Monitor (Mac) and check but I'm not always going to 
> >have that convenience. So if I'm able to check periodically my app 
> >CPU usage and it is hitting 100% or more than a threshold I can, from 
> >within the app, check what process is going on or what the activity 
> >the user is doing.
>
>

Re: Is there a API for CPU usage of an app?

Posted by jude <fl...@gmail.com>.
Scout is more for developers when you have access to the running instance.
I'm looking for something the customer can use at runtime on a non debug
instance.

I found this mysterious property while I was looking for memory usage in
flash.system.System:

flash.system.System.processCPUUsage();

But I can't find any documentation on it and it returns 0. I think I can
write a pretty efficient app but zero CPU is just wishful thinking.



On Thu, Dec 10, 2015 at 5:46 PM, Jason Taylor <ja...@dedoose.com> wrote:

> isn't that what Scout is for?  turn on advanced telemetry and pop open
> adobe scout
>
> -----Original Message-----
> From: Alex Harui [mailto:aharui@adobe.com]
> Sent: Thursday, December 10, 2015 3:49 PM
> To: dev@flex.apache.org
> Subject: Re: Is there a API for CPU usage of an app?
>
> I don't know of any way to get that from Flash.
>
> On 12/10/15, 2:23 PM, "jude" <fl...@gmail.com> wrote:
>
> >Is there a API for checking the CPU usage of my AIR app (or Flex)? It's
> >been suggested to check the FPS and see if they drop but that's not
> >what I'm looking for.
> >
> >Background:
> >I was sitting with someone who was using an app I wrote and it was
> >going really slow. It was not a brand new computer. But I wanted to
> >know if it was my app. Because the laptop was in front of me I could
> >open Task Manager
> >(PC) or Activity Monitor (Mac) and check but I'm not always going to
> >have that convenience. So if I'm able to check periodically my app CPU
> >usage and it is hitting 100% or more than a threshold I can, from
> >within the app, check what process is going on or what the activity the
> >user is doing.
>
>

RE: Is there a API for CPU usage of an app?

Posted by Jason Taylor <ja...@dedoose.com>.
isn't that what Scout is for?  turn on advanced telemetry and pop open adobe scout

-----Original Message-----
From: Alex Harui [mailto:aharui@adobe.com] 
Sent: Thursday, December 10, 2015 3:49 PM
To: dev@flex.apache.org
Subject: Re: Is there a API for CPU usage of an app?

I don't know of any way to get that from Flash.

On 12/10/15, 2:23 PM, "jude" <fl...@gmail.com> wrote:

>Is there a API for checking the CPU usage of my AIR app (or Flex)? It's 
>been suggested to check the FPS and see if they drop but that's not 
>what I'm looking for.
>
>Background:
>I was sitting with someone who was using an app I wrote and it was 
>going really slow. It was not a brand new computer. But I wanted to 
>know if it was my app. Because the laptop was in front of me I could 
>open Task Manager
>(PC) or Activity Monitor (Mac) and check but I'm not always going to 
>have that convenience. So if I'm able to check periodically my app CPU 
>usage and it is hitting 100% or more than a threshold I can, from 
>within the app, check what process is going on or what the activity the 
>user is doing.


Re: Is there a API for CPU usage of an app?

Posted by Alex Harui <ah...@adobe.com>.
I don't know of any way to get that from Flash.

On 12/10/15, 2:23 PM, "jude" <fl...@gmail.com> wrote:

>Is there a API for checking the CPU usage of my AIR app (or Flex)? It's
>been suggested to check the FPS and see if they drop but that's not what
>I'm looking for.
>
>Background:
>I was sitting with someone who was using an app I wrote and it was going
>really slow. It was not a brand new computer. But I wanted to know if it
>was my app. Because the laptop was in front of me I could open Task
>Manager
>(PC) or Activity Monitor (Mac) and check but I'm not always going to have
>that convenience. So if I'm able to check periodically my app CPU usage
>and
>it is hitting 100% or more than a threshold I can, from within the app,
>check what process is going on or what the activity the user is doing.