Ejemplo n.º 1
0
        /// <summary>
        /// Start recording metric data
        /// </summary>
        /// <param name="oid"></param>
        /// <param name="objType"></param>
        /// <param name="msgId"></param>
        public static void profileStart(String oid, IElementDef objType, String msgId)
        {
            ProfilerUtils.
            Adk.Log.Debug("SIFProfilerClient instance name: " + fProfName);
            ProfilerUtils.setProfilerSessionId(sessionId);
            ADK.getLog().debug("SIFProfilerClient session ID: " + fSessionId);


            OpenADK.sifprofiler.SIFProfilerClient c = com.OpenADK.sifprofiler.SIFProfilerClient.getInstance(fProfName);
            if (c != null)
            {
                short objTypeCode = c.getObjectTypeCode(objType);
                c.metricStart(oid + "." + objTypeCode, msgId, objTypeCode);
            }
        }
Ejemplo n.º 2
0
        ///<summary>
        ///Called by the agent when it is ready to initialize the SIFProfilerClient instance
        ///of the ADK. This must be done after the agent has learned the Session ID to associate
        ///with all recorded metrics.
        ///</summary>
        public static void StartProfiling(int sessionId, ObjectTypeCodes otcImpl)
        {
            Adk.Log.Debug("SIFProfilerClient instance name: " + fProfName);
            ProfilerUtils.setProfilerSessionId(sessionId);
            ADK.getLog().debug("SIFProfilerClient session ID: " + fSessionId);


            com.OpenADK.sifprofiler.SIFProfilerClient prof =
                com.OpenADK.sifprofiler.SIFProfilerClient.getInstance(fProfName);
            if (prof != null)
            {
                try {
                    prof.setObjectTypeCodesImpl(otcImpl);
                    prof.open(new com.OpenADK.sifprofiler.api.ProfilerSession(ProfilerUtils.getProfilerSessionId()));
                } catch (Exception ex) {
                    Console.WriteLine("Failed to open SIFProfilerClient instance: " + ex);
                    System.exit(-1);
                }
            }
        }