public void BackendEvent(BackendActionType action, BackendEventType type, string path, long size) { foreach (var s in m_sinks) { s.BackendEvent(action, type, path, size); } }
public void BackendEvent(BackendActionType action, BackendEventType type, string path, long size) { lock (m_lock) if (type == BackendEventType.Started) { if (action == BackendActionType.Put) { Console.WriteLine(" Uploading file ({0}) ...", Library.Utility.Utility.FormatSizeString(size)); } else if (action == BackendActionType.Get) { Console.WriteLine(" Downloading file ({0}) ...", size < 0 ? "unknown" : Library.Utility.Utility.FormatSizeString(size)); } else if (action == BackendActionType.List) { Console.WriteLine(" Listing remote folder ..."); } else if (action == BackendActionType.CreateFolder) { Console.WriteLine(" Creating remote folder ..."); } else if (action == BackendActionType.Delete) { Console.WriteLine(" Deleting file {0}{1} ...", path, size < 0 ? "" : (" (" + Library.Utility.Utility.FormatSizeString(size) + ")")); } } }
public void BackendEvent(BackendActionType action, BackendEventType type, string path, long size) { lock (m_lock) if (type == BackendEventType.Started) { switch (action) { case BackendActionType.Put: Output.WriteLine(" Uploading file ({0}) ...", Library.Utility.Utility.FormatSizeString(size)); break; case BackendActionType.Get: Output.WriteLine(" Downloading file ({0}) ...", size < 0 ? "unknown" : Library.Utility.Utility.FormatSizeString(size)); break; case BackendActionType.List: Output.WriteLine(" Listing remote folder ..."); break; case BackendActionType.CreateFolder: Output.WriteLine(" Creating remote folder ..."); break; case BackendActionType.Delete: Output.WriteLine(" Deleting file {0}{1} ...", path, size < 0 ? "" : (" (" + Library.Utility.Utility.FormatSizeString(size) + ")")); break; } } }
public void BackendEvent(BackendActionType action, BackendEventType type, string path, long size) { lock(m_lock) if (type == BackendEventType.Started) { if (action == BackendActionType.Put) Console.WriteLine(" Uploading file ({0}) ...", Library.Utility.Utility.FormatSizeString(size)); else if (action == BackendActionType.Get) Console.WriteLine(" Downloading file ({0}) ...", size < 0 ? "unknown" : Library.Utility.Utility.FormatSizeString(size)); else if (action == BackendActionType.List) Console.WriteLine(" Listing remote folder ..."); else if (action == BackendActionType.CreateFolder) Console.WriteLine(" Creating remote folder ..."); else if (action == BackendActionType.Delete) Console.WriteLine(" Deleting file {0}{1} ...", path, size < 0 ? "" : (" (" + Library.Utility.Utility.FormatSizeString(size) + ")")); } }
public void AddBackendEvent(BackendActionType action, BackendEventType type, string path, long size) { if (m_parent != null) { m_parent.AddBackendEvent(action, type, path, size); } else { if (type == BackendEventType.Started) { this.BackendProgressUpdater.StartAction(action, path, size); } Logging.Log.WriteMessage(string.Format("Backend event: {0} - {1}: {2} ({3})", action, type, path, size <= 0 ? "" : Library.Utility.Utility.FormatSizeString(size)), Duplicati.Library.Logging.LogMessageType.Information); if (MessageSink != null) { MessageSink.BackendEvent(action, type, path, size); } } }
public void SendEvent(BackendActionType action, BackendEventType type, string path, long size) { if (type == BackendEventType.Started) { System.Threading.Interlocked.Increment(ref m_remoteCalls); } else if (type == BackendEventType.Retrying) { System.Threading.Interlocked.Increment(ref m_retryAttemptCount); } else if (type == BackendEventType.Completed) { switch (action) { case BackendActionType.CreateFolder: System.Threading.Interlocked.Increment(ref m_foldersCreated); break; case BackendActionType.List: break; case BackendActionType.Delete: System.Threading.Interlocked.Increment(ref m_filesDeleted); break; case BackendActionType.Get: System.Threading.Interlocked.Increment(ref m_filesDownloaded); System.Threading.Interlocked.Add(ref m_bytesDownloaded, size); break; case BackendActionType.Put: System.Threading.Interlocked.Increment(ref m_filesUploaded); System.Threading.Interlocked.Add(ref m_bytesUploaded, size); break; } } base.AddBackendEvent(action, type, path, size); }
public void AddBackendEvent(BackendActionType action, BackendEventType type, string path, long size) { if (m_parent != null) { m_parent.AddBackendEvent(action, type, path, size); } else { lock (Logging.Log.Lock) { if (m_is_reporting) { return; } try { m_is_reporting = true; if (type == BackendEventType.Started) { this.BackendProgressUpdater.StartAction(action, path, size); } Logging.Log.WriteInformationMessage(LOGTAG, "BackendEvent", "Backend event: {0} - {1}: {2} ({3})", action, type, path, size <= 0 ? "" : Library.Utility.Utility.FormatSizeString(size)); if (MessageSink != null) { MessageSink.BackendEvent(action, type, path, size); } } finally { m_is_reporting = false; } } } }
public void AddBackendEvent(BackendActionType action, BackendEventType type, string path, long size) { if (m_parent != null) { m_parent.AddBackendEvent(action, type, path, size); } else { if (type == BackendEventType.Started) this.BackendProgressUpdater.StartAction(action, path, size); Logging.Log.WriteMessage(string.Format("Backend event: {0} - {1}: {2} ({3})", action, type, path, size <= 0 ? "" : Library.Utility.Utility.FormatSizeString(size)), Duplicati.Library.Logging.LogMessageType.Information); if (MessageSink != null) MessageSink.BackendEvent(action, type, path, size); } }
public Task SendEventAsync(BackendActionType action, BackendEventType type, string path, long size, bool updateProgress = true) { return(RunOnMain(() => m_bw.SendEvent(action, type, path, size, updateProgress))); }
public Task SendEventAsync(BackendActionType action, BackendEventType type, string path, long size) { return(RunOnMain(() => m_bw.SendEvent(action, type, path, size))); }