internal byte[] GetPerformanceData(string item)
 {
     if (this.performanceMonitor == null)
     {
         lock (InternalSyncObject)
         {
             if (this.performanceMonitor == null)
             {
                 this.performanceMonitor = new PerformanceMonitor(this.machineName);
             }
         }
     }
     return(this.performanceMonitor.GetData(item));
 }
        internal byte[] GetPerformanceData(string item)
        {
            if (_performanceMonitor == null)
            {
                lock (LazyInitializer.EnsureInitialized(ref s_internalSyncObject))
                {
                    if (_performanceMonitor == null)
                    {
                        _performanceMonitor = new PerformanceMonitor(_machineName);
                    }
                }
            }

            return(_performanceMonitor.GetData(item));
        }
        internal byte[] GetPerformanceData(string item) {
            if (this.performanceMonitor == null) {
                lock (InternalSyncObject) {
                    if (this.performanceMonitor == null)
                        this.performanceMonitor = new PerformanceMonitor(this.machineName);
                }
            }

           return this.performanceMonitor.GetData(item);
        }
        internal void Close() {
            if (this.performanceMonitor != null) {
                this.performanceMonitor.Close();
                this.performanceMonitor = null;
            }

            CloseTables();
        }
示例#5
0
 void performanceMonitor_PerfValuesReceived(object sender, PerformanceMonitor.PerfValuesEventArgs e)
 {
     switch (e.processName)
     {
         case "ffmpeg":
             lblFFmpegCPU.InvokeIfRequired(c => c.Text = String.Format("{0:0}%", e.cpuPercentage));
             lblFFmpegRAM.InvokeIfRequired(c => c.Text = String.Format("{0} K", e.ramK.ToString("N0")));
             break;
         case "BMDStreamingServer":
             lblBMDStreamingServerCPU.InvokeIfRequired(c => c.Text = String.Format("{0:0}%", e.cpuPercentage));
             lblBMDStreamingServerRAM.InvokeIfRequired(c => c.Text = String.Format("{0} K", e.ramK.ToString("N0")));
             break;
         case "UNIcast Recorder":
             lblUNIcastCPU.InvokeIfRequired(c => c.Text = String.Format("{0:0}%", e.cpuPercentage));
             lblUNIcastRAM.InvokeIfRequired(c => c.Text = String.Format("{0} K", e.ramK.ToString("N0")));
             break;
         // Debug
         case "UNIcast Recorder.vshost":
             lblUNIcastCPU.InvokeIfRequired(c => c.Text = String.Format("{0:0}%", e.cpuPercentage));
             lblUNIcastRAM.InvokeIfRequired(c => c.Text = String.Format("{0} K", e.ramK.ToString("N0")));
             break;
         default:
             break;
     }
 }
示例#6
0
文件: Scene.cs 项目: nromik/sharpgl
        /// <summary>
        /// This function draws all of the objects in the scene (i.e. every quadric
        /// in the quadrics arraylist etc).
        /// </summary>
        public virtual void Draw()
        {
            //	Create a performance monitor.
            PerformanceMonitor performance = new PerformanceMonitor();

            performance.Monitor("Clearing buffers");

            //	Set the clear color.
            float[] clear = clearColour;
            gl.ClearColor(clear[0], clear[1], clear[2], clear[3]);

            //  TODO: this is big overhead- one should only reproject when the camera moves.
            if (currentCamera != null)
                currentCamera.Project(gl);

            //	Clear.
            gl.Clear(OpenGL.COLOR_BUFFER_BIT | OpenGL.DEPTH_BUFFER_BIT |
                OpenGL.STENCIL_BUFFER_BIT);

            gl.BindTexture(OpenGL.TEXTURE_2D, 0);
            gl.Enable(OpenGL.TEXTURE_2D);

            gl.Enable(OpenGL.LIGHTING);

            if(designMode)
            {
                performance.Monitor("Drawing Stock Scene");
                gl.StockDrawing.DrawGrid(gl);
            }

            performance.Monitor("Setting and drawing Lights");

            foreach(Light light in lights)
            {
                //	Set the lights properties into our OpenGL.
                light.Set(gl);

                //	Draw the light into OpenGL.
                if(designMode)
                    light.Draw(gl);
            }

            performance.Monitor("Drawing Custom Objects");

            //  TODO: Adding this code here re-enables textures- it should work without it but it
            //  doesn't, look into this.

            foreach(SceneObject ob in sceneObjects)
                ob.Draw(gl);

            performance.Monitor("Drawing Quadrics");

            //  TODO: Adding this code here re-enables textures- it should work without it but it
            //  doesn't, look into this.

            foreach(Quadric quad in quadrics)
                quad.Draw(gl);

            performance.Monitor("Drawing Evaluators");

            //  TODO: Adding this code here re-enables textures- it should work without it but it
            //  doesn't, look into this.

            foreach(Evaluator evaluator in evaluators)
                evaluator.Draw(gl);

            performance.Monitor("Drawing Cameras");

            foreach(Camera cam in cameras)
            {
                if(designMode)
                    cam.Draw(gl);
            }

            performance.Monitor("Drawing Polygons");

            //  TODO: Adding this code here re-enables textures- it should work without it but it
            //  doesn't, look into this.
            gl.BindTexture(OpenGL.TEXTURE_2D, 0);
            gl.Enable(OpenGL.TEXTURE_2D);

            foreach(Polygon poly in polygons)
            {
                //	Draw the polygon into OpenGL.
                poly.Draw(gl);

                if(poly.CastsShadow)
                    poly.CastShadow(gl, lights);
            }

            gl.Flush();

            performance.EndMonitor();

            if(drawPerformance)
                performance.Draw(gl.GDIGraphics);
        }