Ejemplo n.º 1
0
 // See IPullStatsProvider
 public string GetStats()
 {
     return(string.Format("{0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7}",
                          SendQueue.Count(),
                          IncomingPacketQueue.Count,
                          OutgoingPacketQueue.Count,
                          ResendOutgoingPacketQueue.Count,
                          LandOutgoingPacketQueue.Count,
                          WindOutgoingPacketQueue.Count,
                          CloudOutgoingPacketQueue.Count,
                          TaskOutgoingPacketQueue.Count,
                          TextureOutgoingPacketQueue.Count,
                          AssetOutgoingPacketQueue.Count));
 }
Ejemplo n.º 2
0
        public void RegionLoaded(Scene s)
        {
            if (!m_Enabled)
            {
                return;
            }

            if (s_processedRequestsStat == null)
            {
                s_processedRequestsStat =
                    new Stat(
                        "ProcessedFetchInventoryRequests",
                        "Number of processed fetch inventory requests",
                        "These have not necessarily yet been dispatched back to the requester.",
                        "",
                        "inventory",
                        "httpfetch",
                        StatType.Pull,
                        MeasuresOfInterest.AverageChangeOverTime,
                        stat => { stat.Value = ProcessedRequestsCount; },
                        StatVerbosity.Debug);
            }

            if (s_queuedRequestsStat == null)
            {
                s_queuedRequestsStat =
                    new Stat(
                        "QueuedFetchInventoryRequests",
                        "Number of fetch inventory requests queued for processing",
                        "",
                        "",
                        "inventory",
                        "httpfetch",
                        StatType.Pull,
                        MeasuresOfInterest.AverageChangeOverTime,
                        stat => { stat.Value = m_queue.Count(); },
                        StatVerbosity.Debug);
            }

            StatsManager.RegisterStat(s_processedRequestsStat);
            StatsManager.RegisterStat(s_queuedRequestsStat);

            m_InventoryService = Scene.InventoryService;
            m_LibraryService   = Scene.LibraryService;

            // We'll reuse the same handler for all requests.
            m_webFetchHandler = new FetchInvDescHandler(m_InventoryService, m_LibraryService, Scene);

            Scene.EventManager.OnRegisterCaps += RegisterCaps;

            m_NumberScenes++;

            int nworkers = 2; // was 2

            if (ProcessQueuedRequestsAsync && m_workerThreads == null)
            {
                m_workerThreads = new Thread[nworkers];

                for (uint i = 0; i < nworkers; i++)
                {
                    m_workerThreads[i] = WorkManager.StartThread(DoInventoryRequests,
                                                                 String.Format("InventoryWorkerThread{0}", i),
                                                                 ThreadPriority.Normal,
                                                                 true,
                                                                 true,
                                                                 null,
                                                                 int.MaxValue);
                }
            }
        }