GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - NLog/NLog.PerformanceCounter: NLog extensions for displaying and updating Windows Performance Counters

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
NLog.PerformanceCounter.sln
NLog.PerformanceCounter.sln
 
 
README.md
README.md
 
 
codecov.yml
codecov.yml
 
 

Repository files navigation

NLog.PerformanceCounter

NLog extensions to Display Windows Performance Counters and Update Windows Performance Counters

Version CI

How to install

  1. Install the package

    Install-Package NLog.PerformanceCounter or in your csproj:

    <PackageReference Include="NLog.PerformanceCounter" Version="6.*" />
  2. Add to your nlog.config:

    <extensions>
        <add assembly="NLog.PerformanceCounter"/>
    </extensions>

    Alternative register from code using fluent configuration API:

    LogManager.Setup().SetupExtensions(ext => {
       ext.RegisterTarget<NLog.Targets.PerformanceCounterTarget>();
       ext.RegisterLayoutRenderer<NLog.LayoutRenderers.PerformanceCounterLayoutRenderer>();
    });

Example of displaying PerformanceCounter

Example of NLog.config-file that displays Windows Performance Counter value:

<nlog>
    <extensions>
        <add assembly="NLog.PerformanceCounter"/>
    </extensions>
    <targets>
        <target name="console" xsi:type="console" layout="${message}|Memory=${performancecounter:category=Process:counter=Working Set}"  />
    </targets>
    <rules>
        <logger minLevel="Info" writeTo="console" />
    </rules>
</nlog>

Example of updating PerformanceCounter

Example of NLog.config-file that updates Windows Performance Counter value:

<nlog>
    <extensions>
        <add assembly="NLog.PerformanceCounter"/>
    </extensions>
    <targets>
        <target name="perf" xsi:type="PerfCounter" counterName="123" categoryName="xyz" />
    </targets>
    <rules>
        <logger minLevel="Info" writeTo="perf" />
    </rules>
</nlog>

About

NLog extensions for displaying and updating Windows Performance Counters

Topics

csharpdotnetnlognlog-targetperformancecounter

Resources

Readme
BSD-3-Clause license
Activity
Custom properties

Stars

0 stars

Watchers

2 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.