/// <summary> /// Collect MomoryMonitoringData of JetAdvantageLink /// </summary> public void CollectMemoryMonitoringData() { _deviceID = _deviceInfo.AssetId; DeviceUsageCollector collector = new DeviceUsageCollector(_deviceInfo.Address); try { if (_deviceInfo.AssetType != "SFP") { _usageCount = collector.CollectUsageCounts().TotalImageCount; } else { _usageCount = collector.CollectSFPUsageCounts().TotalImageCount; } } catch (Exception ex) { ExecutionServices.SystemTrace.LogError("Get Page Count is failed", ex); _usageCount = -1; } _targetMonitoringPackage = _targetPackage; _memoryUsageData = _linkUI.Controller.GetMemoryUsage(); }
/// <summary> /// Collect device Job profile /// </summary> /// <param name="device"></param> private void CollectDeviceJobProfile(IDeviceInfo device) { DeviceUsageCollector collector = new DeviceUsageCollector(device.Address); RecordEvent(DeviceWorkflowMarker.ActivityBegin, device.AssetId); ProcessUsageCounts(device, collector); RecordEvent(DeviceWorkflowMarker.ActivityEnd, device.AssetId); }
/// <summary> /// Collect the device usage count. /// </summary> /// <param name="device"></param> /// <param name="collector"></param> /// <returns></returns> private void ProcessUsageCounts(IDeviceInfo device, DeviceUsageCollector collector) { DeviceUsageCounts usageCounts = collector.CollectUsageCounts(); DeviceJobSnapshotLog snapshotLog = new DeviceJobSnapshotLog(_executionData.SessionId, device.AssetId, "CollectDeviceJobInfo", usageCounts.PrintTotalImages, DateTime.Now); DeviceJobCountLog usageCountLog = new DeviceJobCountLog(snapshotLog.DeviceJobSnapshotId, usageCounts.TotalColorPageCount, usageCounts.TotalMonoPageCount, usageCounts.AdfTotalImages, usageCounts.FlatbedTotalImages, usageCounts.TotalFaxCount); ExecutionServices.DataLogger.AsInternal().Submit(snapshotLog); ExecutionServices.DataLogger.AsInternal().Submit(usageCountLog); }
/// <summary> /// Collects the memory counter data and records it to the database. /// </summary> /// <param name="snapshotLabel">The snapshot label (i.e. why the memory was retrieved).</param> public void CollectDeviceMemoryCounters(string snapshotLabel) { int imageCount; DeviceUsageCollector collector = new DeviceUsageCollector(_device.Address); if (_device.AssetType != "SFP") { imageCount = collector.CollectUsageCounts().TotalImageCount; } else { imageCount = collector.CollectSFPUsageCounts().TotalImageCount; } CollectDeviceMemoryCounters(snapshotLabel, imageCount); }