资源简介

SignalR+Chart.js+TypeScript整合开发CPU使用率实时图表

资源截图

代码片段和文件信息

using Microsoft.AspNet.SignalR.Client;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace RefreshCPUUtilization
{
    class Program
    {
        static void Main(string[] args)
        {
            var hubConnection = new HubConnection(“http://localhost:10282/“);
            IHubProxy proxy = hubConnection.CreateHubProxy(“AppHub“);
            hubConnection.Start().Wait();

            PerformanceCounter cpuCounter = new PerformanceCounter
            {
                CategoryName = “Processor“
                CounterName = “% Processor Time“
                InstanceName = “_Total“
            };
            while (true)
            {
                string cpuUsage = (cpuCounter.NextValue()).ToString();
                Console.WriteLine(cpuUsage);
                proxy.Invoke(“RefreashValue“ cpuUsage);
                Thread.Sleep(1000);
            }
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     145895  2014-05-21 16:54  CPUUsage\1.png

     文件     287604  2014-05-21 15:36  CPUUsage\Chart.js-master.zip

     文件     214129  2014-05-19 18:19  CPUUsage\packages\jQuery.1.6.4\Content\scripts\jquery-1.6.4-vsdoc.js

     文件     238159  2014-05-19 18:19  CPUUsage\packages\jQuery.1.6.4\Content\scripts\jquery-1.6.4.js

     文件      91669  2014-05-19 18:19  CPUUsage\packages\jQuery.1.6.4\Content\scripts\jquery-1.6.4.min.js

     文件     231459  2014-05-19 18:19  CPUUsage\packages\jQuery.1.6.4\jQuery.1.6.4.nupkg

     文件        914  2014-05-19 18:19  CPUUsage\packages\jQuery.1.6.4\Tools\install.ps1

     文件     216286  2014-05-19 18:19  CPUUsage\packages\jQuery.1.6.4\Tools\jquery-1.6.4-vsdoc-para.js

     文件       1455  2014-05-19 18:19  CPUUsage\packages\jQuery.1.6.4\Tools\uninstall.ps1

     文件     193484  2014-05-19 18:27  CPUUsage\packages\jquery.Typescript.DefinitelyTyped.0.8.6\Content\scripts\typings\jquery\jquery.d.ts

     文件      25856  2014-05-19 18:27  CPUUsage\packages\jquery.Typescript.DefinitelyTyped.0.8.6\jquery.Typescript.DefinitelyTyped.0.8.6.nupkg

     文件       4044  2014-05-19 18:19  CPUUsage\packages\Microsoft.AspNet.SignalR.2.0.3\Microsoft.AspNet.SignalR.2.0.3.nupkg

     文件       1968  2014-05-19 18:19  CPUUsage\packages\Microsoft.AspNet.SignalR.2.0.3\readme.txt

     文件     124088  2014-05-20 20:48  CPUUsage\packages\Microsoft.AspNet.SignalR.Client.2.0.3\lib\net40\Microsoft.AspNet.SignalR.Client.dll

     文件      50876  2014-05-20 20:48  CPUUsage\packages\Microsoft.AspNet.SignalR.Client.2.0.3\lib\net40\Microsoft.AspNet.SignalR.Client.xml

     文件     134328  2014-05-20 20:48  CPUUsage\packages\Microsoft.AspNet.SignalR.Client.2.0.3\lib\net45\Microsoft.AspNet.SignalR.Client.dll

     文件      51957  2014-05-20 20:48  CPUUsage\packages\Microsoft.AspNet.SignalR.Client.2.0.3\lib\net45\Microsoft.AspNet.SignalR.Client.xml

     文件     113848  2014-05-20 20:48  CPUUsage\packages\Microsoft.AspNet.SignalR.Client.2.0.3\lib\portable-net45+sl5+netcore45+wp8\Microsoft.AspNet.SignalR.Client.dll

     文件      46854  2014-05-20 20:48  CPUUsage\packages\Microsoft.AspNet.SignalR.Client.2.0.3\lib\portable-net45+sl5+netcore45+wp8\Microsoft.AspNet.SignalR.Client.xml

     文件     185710  2014-05-20 20:48  CPUUsage\packages\Microsoft.AspNet.SignalR.Client.2.0.3\Microsoft.AspNet.SignalR.Client.2.0.3.nupkg

     文件     321720  2014-05-19 18:19  CPUUsage\packages\Microsoft.AspNet.SignalR.Core.2.0.3\lib\net45\Microsoft.AspNet.SignalR.Core.dll

     文件     191130  2014-05-19 18:19  CPUUsage\packages\Microsoft.AspNet.SignalR.Core.2.0.3\lib\net45\Microsoft.AspNet.SignalR.Core.xml

     文件     158981  2014-05-19 18:19  CPUUsage\packages\Microsoft.AspNet.SignalR.Core.2.0.3\Microsoft.AspNet.SignalR.Core.2.0.3.nupkg

     文件     116263  2014-05-19 18:19  CPUUsage\packages\Microsoft.AspNet.SignalR.JS.2.0.3\content\scripts\jquery.signalR-2.0.3.js

     文件      33463  2014-05-19 18:19  CPUUsage\packages\Microsoft.AspNet.SignalR.JS.2.0.3\content\scripts\jquery.signalR-2.0.3.min.js

     文件      35538  2014-05-19 18:19  CPUUsage\packages\Microsoft.AspNet.SignalR.JS.2.0.3\Microsoft.AspNet.SignalR.JS.2.0.3.nupkg

     文件      14008  2014-05-19 18:19  CPUUsage\packages\Microsoft.AspNet.SignalR.SystemWeb.2.0.3\lib\net45\Microsoft.AspNet.SignalR.SystemWeb.dll

     文件       7588  2014-05-19 18:19  CPUUsage\packages\Microsoft.AspNet.SignalR.SystemWeb.2.0.3\lib\net45\Microsoft.AspNet.SignalR.SystemWeb.xml

     文件      11843  2014-05-19 18:19  CPUUsage\packages\Microsoft.AspNet.SignalR.SystemWeb.2.0.3\Microsoft.AspNet.SignalR.SystemWeb.2.0.3.nupkg

     文件      79536  2014-05-19 18:19  CPUUsage\packages\Microsoft.Owin.2.0.1\lib\net40\Microsoft.Owin.dll

............此处省略171个文件信息

评论

共有 条评论