How to use custom performance counters to monitor my app?

Hi,
I have a app which will read messages from a specified service bus queue. I want to monitor how many messages it read from service bus queue in the last minutes. And I want to use a custom performance counter to achieve that.
Then I first initialized the PerformanceCounterCategory by the following code:
var counterCreationData = new CounterCreationData
CounterName = "numberOfMessages",
CounterHelp = "help",
CounterType = PerformanceCounterType.NumberOfItems32
var counterCollection = new CounterCreationDataCollection();
counterCollection.Add(counterCreationData);
PerformanceCounterCategory.Create(
"CustomCounterCategory",
"CategoryDescription",
PerformanceCounterCategoryType.SingleInstance,
counterCollection);
Then when my code receive messages, I just call the IncrementBy() method to count the messages. below is the code snippet:
private static readonly PerformanceCounter Counter = new PerformanceCounter("CustomCounterCategory", "numberOfMessages", string.Empty, false);
private void OnReceive()
var messages = _subscriptionClient.ReceiveBatch(32);
var brokeredMessages = messages as IList<BrokeredMessage> ?? messages.ToList();
if (messages != null && brokeredMessages.Any())
Counter.IncrementBy(messages.Count);
MessageReceived(this, brokeredMessages);
When I check the data from the azure table, "WADPerformanceCountersTable".  The CounterValue is just simply increasing. It is not the numbers of received messages in last minutes.
To get the numbers of received messages in last minutes, how should I write my code?
BTW, I'm using the AZure SDK 2.5. The transfer interval is set to 1 min, sample rate set to 20 sec. This might be changed.
Thanks.

The performance counter type you're using is a simple counter. You should use rate counter instead. But the issue is that there's no per minute counter, by default the rate counters come as per second. Please check counter types from below MSDN page.
https://msdn.microsoft.com/en-us/library/system.diagnostics.performancecountertype(v=vs.110).aspx

Similar Messages

  • HOW TO: using custom fonts in native storyboard views from an ANE on iOS

    Hey,
      In our apps, we have embedded storyboards into an ANE, and successfully used those screens in an AIR app, and figured out how to use custom fonts in those views.
      I wrote a quick blog post about it and just thought I'd share it real quick in case it helps someone.
    ANE for iOS with Custom Framework – Using Custom Fonts | khef.co

    Hi WayHsieh,
    >>can I just "install" fonts through Word App? Does Word Apps have enough privilege to install fonts on Windows? Can I just click a button in Word App, and then it will install fonts automatically?<<
    Based on my understanding, it is hard to achieve the goal. Because the app webpage is hosted inside an Internet Explorer control which, in turn, is hosted inside an app runtime process that provides security and performance isolation and it is under
    low-Integrity level.
    Here is the figure for apps for Office runtime environment in Windows-based desktop and tablet clients:
    You can get more detail about Privacy and security from links below:
    Privacy and security for apps for Office
    Hope it is helpful.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to use custome tag lib in the JSP page?

    How to use custome tag lib in the JSP page?...with JDeveloper

    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.2/state/content/navId.4/navSetId._/vtTopicFile.working_with_jsp_pages%7Cjsp_ptagsregistering~html/

  • How to use custom tag in jsp

    sir
    plz tell me how to use custom tag in jsp.plz describe it.
    i will be thankful to u

    Do you want to use taglibs or develop custom tags? Either way take a look at these:
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPTags.html
    http://www.stardeveloper.com/articles/display.html?article=2001081301&page=1
    http://www.onjava.com/pub/a/onjava/2000/12/15/jsp_custom_tags.html
    http://jakarta.apache.org/taglibs/tutorial.html
    http://www.ibm.com/developerworks/edu/j-dw-java-custom-i.html
    http://www.herongyang.com/jsp/tag.html

  • How to use custom control.

    hi all,
        how to use custom controls in screen painter.
    can i add image to my screen  using custom control.
    is there any other way to display image on screen.
    give me some notes about custom control.
    and sample programs to display image and also the use of custom control.
    regards,
    bhaskar.

    hi vinod,
    u can use the class <b>cl_gui_picture</b> to work around with pictures on the screen
    just define a custom control on the screen
    create an object of custom container.
    create another object of cl_gui_picture giving container name as the parent name...
    u can check out the class using the transn se24....
    pls post if additional info is required...
    Regards,
    Vs

  • When i update apps on my iphone they need the ID that i used when i downloaded these app and i forgot this ID and a make a new ID how i used the new one to update these apps thanks

    Hello all,
    when i update apps on my iphone they need the ID that i used when i downloaded these apps and i forgot this ID and a make a new ID
    How i used the new one to update these apps?
    thanks

    Your device can hold apps from multiple IDs, but to update them you have to swicth identities which is time consuming. If possible use only the one ID. If you need to reset the password for your old ID visit My Apple ID.
    tt2

  • How do use my ITunes balance to pay for Apps

    How do use my ITunes balance to pay for Apps?

    You just buy what you want.  If you have a credit (balance), it is automatically used before you are billed (if you run over your balance).
    How to manage unused iTunes Gift Card and Gift Certificate balances
    "Each time you purchase content, iTunes will deduct funds from the credit until it's depleted."

  • How to view custom performance counter data?

    I have created a new MVC application and have added Application Insights to the project. I modified the ApplicationInsights.config file to start collecting the performance counter for Memory\Page Faults/sec. How can I tell if this data is making it to App
    Insights? I can't see the data in the portal. When I add a chart in metrics explorer this counter does not exist under the Performance Counters.
    Where do I go to view this data? How can I determine if it's working or not? Also the documentation I'm finding on the subject appears to be outdated. Is MMA still used to capture this data? If not, what is used now? Do I need to restart something in order
    for this data to start getting collected?
    Here is my config:
    <?xml version="1.0" encoding="utf-8"?>
    <ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings" schemaVersion="2014-05-30">  
      <TelemetryModules>
        <Add Type="Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing.DiagnosticsTelemetryModule, Microsoft.ApplicationInsights" />
        <Add Type="Microsoft.ApplicationInsights.Extensibility.RuntimeTelemetry.RemoteDependencyModule, Microsoft.ApplicationInsights.Extensibility.RuntimeTelemetry" />
        <Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCollector.PerformanceCollectorModule, Microsoft.ApplicationInsights.Extensibility.PerfCollector" />
        <Add Type="Microsoft.ApplicationInsights.Extensibility.Web.WebApplicationLifecycleModule, Microsoft.ApplicationInsights.Extensibility.Web" />
        <Add Type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.TelemetryModules.WebRequestTrackingTelemetryModule, Microsoft.ApplicationInsights.Extensibility.Web" />
        <Add Type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.TelemetryModules.WebExceptionTrackingTelemetryModule, Microsoft.ApplicationInsights.Extensibility.Web" />
        <Add Type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.TelemetryModules.WebSessionTrackingTelemetryModule, Microsoft.ApplicationInsights.Extensibility.Web" />
        <Add Type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.TelemetryModules.WebUserTrackingTelemetryModule, Microsoft.ApplicationInsights.Extensibility.Web" />
      </TelemetryModules>
      <ContextInitializers>
        <Add Type="Microsoft.ApplicationInsights.Extensibility.ComponentContextInitializer, Microsoft.ApplicationInsights" />
        <Add Type="Microsoft.ApplicationInsights.Extensibility.DeviceContextInitializer, Microsoft.ApplicationInsights" />
        <Add Type="Microsoft.ApplicationInsights.Extensibility.Web.AzureRoleEnvironmentContextInitializer, Microsoft.ApplicationInsights.Extensibility.Web" />
      </ContextInitializers>
      <TelemetryInitializers>
        <Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryInitializers.WebOperationNameTelemetryInitializer, Microsoft.ApplicationInsights.Extensibility.Web" />
        <Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryInitializers.WebOperationIdTelemetryInitializer, Microsoft.ApplicationInsights.Extensibility.Web" />
      </TelemetryInitializers>
      <InstrumentationKey>*snip*</InstrumentationKey>
      <PerformanceCounters>
        <PerformanceCounterConfiguration counterSpecifier="\Memory\Page Faults/sec"/>
      </PerformanceCounters>
    </ApplicationInsights>

    Can you please let us know which documentation you're referring to? It does seem to be outdated.
    Application Insights collects certain performance counters on its own; unfortunately, the list of performance counters is not configurable as of now. The syntax you're using
    <PerformanceCounters>
        <PerformanceCounterConfiguration counterSpecifier="\Memory\Page Faults/sec"/>
      </PerformanceCounters>
    is not supported.
    Performance data will be collected automatically (no further configuration needed) as long as the following element is in your ApplicationInsights.config (and it is indeed present in your sample):
      <Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCollector.PerformanceCollectorModule,
    Microsoft.ApplicationInsights.Extensibility.PerfCollector" />
    Performance counters currently collected by Application Insights are:
    \Process(<application process>)\% Processor Time
    \Memory\Available MBytes
    \ASP.NET Applications(<IIS process>)\Requests/Sec
    \.NET CLR Exceptions(<application process>)\# of Exceps Thrown / sec
    \ASP.NET Applications(<IIS process>)\Request Execution Time
    \Process(<application process>)\Private Bytes
    \Process(<application process>)\IO Data Bytes/sec
    \ASP.NET Applications(<IIS process>)\Requests In Application Queue
    \Processor(_Total)\% Processor Time
    There are additional factors that may affect performance collection; this blog article contains a section detailing performance collection in Application Insights SDK:
    http://blogs.msdn.com/b/visualstudioalm/archive/2014/12/11/updated-application-insights-status-monitor-to-support-12-and-later-application-insights-sdk.aspx
    Please check out the section starting with the words "One of the changes made in the .12 version
    of the Application
    Insights for Web Applications SDK is the collection of the following Windows performance counters."
    As you can see from the blog post, you are indeed looking in the right place in the portal (Metric Explorer under Performance Counters), but only the default counters will be collected.
    As a workaround, consider taking advantage of one of TelemetryClient.Track* methods to report data to Application Insights.

  • How to use customer extension table for schedule line for shopping cart ?

    Dear Experts,
    One of our client wants to have schedule lines in shopping cart item. I am thinking of using customer extension table at item level for shopping cart. Could you please help me on  how I should proceed with the appending the structures so that the end user can fill the shopping cart schedule line details?
    Which fields should I consider in such cases?
    Thanks and regards,
    Ranjan

    Hi.
    I guess you use SRM 7.0. Please go to IMG.
    SRM -> SRM Server -> Cross-Application Basic Settings -> Extensions and Field Control (Personalization) -> Create Table Extensions and Supply with Data
    Regards,
    Masa

  • Question about How to Use Custom CellEditors

    Hi:
    I have been trying to implement something like this: I have a JPanel, and when you double-click a particular spot on it, I want a textbox to appear. Currently, I am implementing it by using an undecorated JDialog that contains a JTextField in it (such that the text field occupies all the space in the dialog, i.e. you can't even tell that there is a dialog). This seems like a hack to me.
    Another alternative that I have been thinking about is using layered panes, and hiding the textfield below the jpanel, and only bringing it to the front when the user double-clicks.
    Then, I stumbled onto custom celleditors. Now, it seems that everyone is using them in JTables, JLists, JComboBoxes, etc. and I was wondering if it is something that I can use with a JPanel.
    Can anyone comment on the implementations I am considering, as well as using custom celleditors with a JPanel?
    Thanks in advance,
    LordKelvan

    Still don't understand your requirement. Does the text field stay there or disappear after the data is entered? If it disappears, then how do you change the value, do you have to click on the exact same pixel again?
    Maybe you could use a MouseListener and then display a JOptionPane or JDialog to prompt for the information. Or if you want to display a JTextField then add a JTextField to the panel and then when the user enters the data by using the enter key or by clicking elsewhere on the GUI you remove the text field from the panel.

  • How to use custom API's

    Hi All,
    In OIM how can i use my own/Custom API"S. Wher do i need to place the Jar/Class files. Like in other Identity Management tools (I only have the experience of SUN) you can place the files under WEB-INF/lib or WEB-INF/classes and then can easily use them, does OIM provides this/similar kind of functionality and how we can use that.

    Hi,
    If you want to use custom API to create adapter then put the jar file in <OIM_Install>/xellerate/Java Task/
    folder and if you want to use them to create task Schedular then put it in <OIM_Install>/xellerate/Schedular/
    regards

  • How to use Custom Search in Dynamic Page or HTML Portlet ?

    Gurus,
    1. I have a tab called My Space in the portal web site, where user gets a personalized view of the content.
    2. I am using custom attributes and custom item types. I have a custom attribute called 'Location', which is a attribute of custom item types.
    3. I have 2 pages - News and Events.
    4. All the content in News and Events page is tagged by the attribute 'Location'.
    5. The requirement is to let the user search the News and Events by Location.
    6. To achieve this I used the Custom Search portlet and the user can select the attribute Location and see the resultant News and Event items by location in the Search portlet.
    7. The requirement is to present the News items and Event items in separate regions on the page and show only the first 5 News and Event items in the result and show a More link which would guide the user to rest of the News and Event items.
    8. Eventually there may be more content other than News and Events tagged by location. If so, the requirement is to create a new region and display the new content.
    9. How would I do this using custom search ? I was thinking if there is anyway I could use the custom search api (where can i find it ?) in the HTML portlet or Dynamic page and submit the result to IFRAMES in each region and show the output ?
    Pls advise.
    Thanx a bunch.

    I would suggest that you use two custom search portlets; one for the news items and one for the events items. Switch the custom search portlets to "AutoQuery" mode and add the relevant criteria. On the results display tab of the the "edit defaults" screen, choose to show just 5 items.
    To add a link to show the user mode results, I'd create two new pages that have just a single custom search portlet on it that is customised to show more of the results and maybe has the pagination links enabled.
    Then I'd add two "Page Link" items underneath the two news and events portlets on the first page in an item region.
    I'm sure there are other ways of doing this as well. Hope that helps to get you started.

  • How to use custom control in Dialog Programming?

    How can I call a subscreen using custom control in Dialog Programming?
    The required subscreen contains a calender. Any class or something available for this purpose. Please suggest.

    As [vinraaj|http://forums.sdn.sap.com/profile.jspa?userID=3968041] wrote, call transaction SE51, there is a Wizard to help you generate the table control, it will create the table control and some includes with PBO/PAI modules > Read [Using the Table Control Wizard|http://help.sap.com/saphelp_bw/helpdata/en/6d/150d67da1011d3963800a0c94260a5/frameset.htm]
    Also there is a tutorial in the wiki, read [Learn Making First Table Control |http://wiki.sdn.sap.com/wiki/display/ABAP/LearnMakingFirstTableControl] by [Krishna Chauhan|http://wiki.sdn.sap.com/wiki/display/~nc0euof]
    Regards,
    Raymond

  • How to use customized exception

    Hi all,
    I have a problem using struts-action-mappings.
    I have a method for update in my app module, and i'm using that method with data action.
    In that method, I have to throw my customized exception to user if there is error. I just don't know how to catch the exception and display it in page.
    I've read about struts page flow diagram elements and know there are Exceptions and Global Exceptions. But i still don't know how to use them.
    What i want to know is can I relate my custom exception with Exceptions/Global Exceptions in struts diagram? And if so, can anybody show me an example for it?
    Thanks

    1.Create a method GET_ACTORS using RH_GET_ACTORS,
    2.Create a container element 'Actors' type string with multiline.
    3.Create Task, where you can call the Method GET_ACTORS  and pass the Container values of 'Actors' from Method->Task->Workflow
    4.Create a Step type before creating the Step mail and include the previous Task.
    5.Now you can create the step Mail. Give the Recipient Type as 'Expression'-> Select the Container Element 'Actors' from WF container
    But remember the values should be Passed from the task to Workflow in Binding correctly.
    Regards,
    Sriyash

  • How to use customized rule in step mail workflow

    Dear All:
    I have created a customized rule,which is working fine when I simulate it, it is fetching SAP user from a ztable which I created.
    My requirement is how to use the rule in my workflow which have one "send mail" step. As in "send mail" under Receipt Type I cant find rule option.
    Kindly help me.
    Rahul.

    1.Create a method GET_ACTORS using RH_GET_ACTORS,
    2.Create a container element 'Actors' type string with multiline.
    3.Create Task, where you can call the Method GET_ACTORS  and pass the Container values of 'Actors' from Method->Task->Workflow
    4.Create a Step type before creating the Step mail and include the previous Task.
    5.Now you can create the step Mail. Give the Recipient Type as 'Expression'-> Select the Container Element 'Actors' from WF container
    But remember the values should be Passed from the task to Workflow in Binding correctly.
    Regards,
    Sriyash

Maybe you are looking for

  • Is Fox Digital Copy available in Sweden through iTunes?

    After being bouncing mails back and forth with Fox Digital Copy Support the last days and still not got any reply to the simple question "Is Fox Digital Copy movies available for iTunes users in Sweden" I thought I could as for any finding here. If y

  • HIgh Inactive sessions

    Hi, We are facing a problem of lot of inactive sessions consuming huge resources. We have setup connection pooling from weblogic application and connection timout and resuse parameters have been setup from application side for connection pooling. And

  • Adobe forms developed with web dynpro

    I developed a standard adobe forms from webdynpro. After deploy to EP, i noticed two thing if i test the result using adobe v7.0.9, the form load in seconds; if i test the result using adobe v8.1.1 adobe reader will suck the available physical memory

  • Workflow - Error starting workitem from Outlook

    Hi, We have an issue in the workflow wherein, the workitem when started from outlook gives an error"Page cannot be displayed" ( like the one we get in a net browser). When the same workitem is started from SAP inbox it works fine. This one seems to b

  • Is it hard to fix bad segments on a failed Hard Drive?? DV6

    I have a DV6-2066dx and my hard drive died on me (Error 303). I took it to get looked at and they say that I have bad segments and I should buy a new HD. My question is, can I fix the segments myself to recover any data and what type of HD should I b