/** * Notifies the request queue that this request has finished (successfully or with error). * * <p>Also dumps all events from this request's event log; for debugging.</p> */ void finish(final String tag) { if (mRequestQueue != null) { mRequestQueue.finish(this); } if (MarkerLog.ENABLED) { final long threadId = Thread.currentThread().getId(); if (Looper.myLooper() != Looper.getMainLooper()) { // If we finish marking off of the main thread, we need to // actually do it on the main thread to ensure correct ordering. Handler mainThread = new Handler(Looper.getMainLooper()); mainThread.post(new Runnable() { @Override public void run() { mEventLog.add(tag, threadId); mEventLog.finish(this.toString()); } }); return; } mEventLog.add(tag, threadId); mEventLog.finish(this.toString()); } }
/** * Closes the log, dumping it to logcat if the time difference between * the first and last markers is greater than {@link #MIN_DURATION_FOR_LOGGING_MS}. * @param header Header string to print above the marker log. */ public synchronized void finish(String header) { mFinished = true; long duration = getTotalDuration(); if (duration <= MIN_DURATION_FOR_LOGGING_MS) { return; } long prevTime = mMarkers.get(0).time; d("(%-4d ms) %s", duration, header); for (Marker marker : mMarkers) { long thisTime = marker.time; d("(+%-4d) [%2d] %s", (thisTime - prevTime), marker.thread, marker.name); prevTime = thisTime; } }
mFinished = true; long duration = getTotalDuration(); if (duration <= MIN_DURATION_FOR_LOGGING_MS) { return; finish("Request on the loose"); e("Marker log finalized without finish() - uncaught exit point for request");
/** * Notifies the request queue that this request has finished (successfully or with error). * * <p>Also dumps all events from this request's event log; for debugging.</p> */ void finish(final String tag) { if (mRequestQueue != null) { mRequestQueue.finish(this); onFinish(); } if (MarkerLog.ENABLED) { final long threadId = Thread.currentThread().getId(); if (Looper.myLooper() != Looper.getMainLooper()) { // If we finish marking off of the main thread, we need to // actually do it on the main thread to ensure correct ordering. Handler mainThread = new Handler(Looper.getMainLooper()); mainThread.post(new Runnable() { @Override public void run() { mEventLog.add(tag, threadId); mEventLog.finish(this.toString()); } }); return; } mEventLog.add(tag, threadId); mEventLog.finish(this.toString()); } }
/** * Notifies the request queue that this request has finished (successfully or with error). * <p> * <p>Also dumps all events from this request's event log; for debugging.</p> */ void finish(final String tag) { mBody=null; if (mRequestQueue != null) { mRequestQueue.finish(this); } if (MarkerLog.ENABLED) { final long threadId = Thread.currentThread().getId(); if (Looper.myLooper() != Looper.getMainLooper()) { // If we finish marking off of the main thread, we need to // actually do it on the main thread to ensure correct ordering. Handler mainThread = new Handler(Looper.getMainLooper()); mainThread.post(new Runnable() { @Override public void run() { mEventLog.add(tag, threadId); mEventLog.finish(this.toString()); } }); return; } mEventLog.add(tag, threadId); mEventLog.finish(this.toString()); } }
long duration = getTotalDuration();
/** * Notifies the request queue that this request has finished (successfully or with error). * * <p>Also dumps all events from this request's event log; for debugging.</p> */ void finish(final String tag) { if (mRequestQueue != null) { mRequestQueue.finish(this); } if (MarkerLog.ENABLED) { final long threadId = Thread.currentThread().getId(); if (Looper.myLooper() != Looper.getMainLooper()) { // If we finish marking off of the main thread, we need to // actually do it on the main thread to ensure correct ordering. Handler mainThread = new Handler(Looper.getMainLooper()); mainThread.post(new Runnable() { @Override public void run() { mEventLog.add(tag, threadId); mEventLog.finish(this.toString()); } }); return; } mEventLog.add(tag, threadId); mEventLog.finish(this.toString()); } }
/** * Notifies the request queue that this request has finished (successfully or with error). * * <p>Also dumps all events from this request's event log; for debugging.</p> */ void finish(final String tag) { if (mRequestQueue != null) { mRequestQueue.finish(this); onFinish(); } if (MarkerLog.ENABLED) { final long threadId = Thread.currentThread().getId(); if (Looper.myLooper() != Looper.getMainLooper()) { // If we finish marking off of the main thread, we need to // actually do it on the main thread to ensure correct ordering. Handler mainThread = new Handler(Looper.getMainLooper()); mainThread.post(new Runnable() { @Override public void run() { mEventLog.add(tag, threadId); mEventLog.finish(this.toString()); } }); return; } mEventLog.add(tag, threadId); mEventLog.finish(this.toString()); } }
/** * Notifies the request queue that this request has finished (successfully or with error). * * <p>Also dumps all events from this request's event log; for debugging.</p> */ void finish(final String tag) { if (mRequestQueue != null) { mRequestQueue.finish(this); onFinish(); } if (MarkerLog.ENABLED) { final long threadId = Thread.currentThread().getId(); if (Looper.myLooper() != Looper.getMainLooper()) { // If we finish marking off of the main thread, we need to // actually do it on the main thread to ensure correct ordering. Handler mainThread = new Handler(Looper.getMainLooper()); mainThread.post(new Runnable() { @Override public void run() { mEventLog.add(tag, threadId); mEventLog.finish(this.toString()); } }); return; } mEventLog.add(tag, threadId); mEventLog.finish(this.toString()); } }
/** * Notifies the request queue that this request has finished (successfully or with error). * * <p>Also dumps all events from this request's event log; for debugging.</p> */ void finish(final String tag) { if (mRequestQueue != null) { mRequestQueue.finish(this); onFinish(); } if (MarkerLog.ENABLED) { final long threadId = Thread.currentThread().getId(); if (Looper.myLooper() != Looper.getMainLooper()) { // If we finish marking off of the main thread, we need to // actually do it on the main thread to ensure correct ordering. Handler mainThread = new Handler(Looper.getMainLooper()); mainThread.post(new Runnable() { @Override public void run() { mEventLog.add(tag, threadId); mEventLog.finish(this.toString()); } }); return; } mEventLog.add(tag, threadId); mEventLog.finish(this.toString()); } }
/** * Notifies the request queue that this request has finished (successfully or with error). * * <p>Also dumps all events from this request's event log; for debugging.</p> */ void finish(final String tag) { if (mRequestQueue != null) { mRequestQueue.finish(this); onFinish(); } if (MarkerLog.ENABLED) { final long threadId = Thread.currentThread().getId(); if (Looper.myLooper() != Looper.getMainLooper()) { // If we finish marking off of the main thread, we need to // actually do it on the main thread to ensure correct ordering. Handler mainThread = new Handler(Looper.getMainLooper()); mainThread.post(new Runnable() { @Override public void run() { mEventLog.add(tag, threadId); mEventLog.finish(this.toString()); } }); return; } mEventLog.add(tag, threadId); mEventLog.finish(this.toString()); } }
/** * Closes the log, dumping it to logcat if the time difference between * the first and last markers is greater than {@link #MIN_DURATION_FOR_LOGGING_MS}. * @param header Header string to print above the marker log. */ public synchronized void finish(String header) { mFinished = true; long duration = getTotalDuration(); if (duration <= MIN_DURATION_FOR_LOGGING_MS) { return; } long prevTime = mMarkers.get(0).time; d("(%-4d ms) %s", duration, header); for (Marker marker : mMarkers) { long thisTime = marker.time; d("(+%-4d) [%2d] %s", (thisTime - prevTime), marker.thread, marker.name); prevTime = thisTime; } }
/** * Closes the log, dumping it to logcat if the time difference between * the first and last markers is greater than {@link #MIN_DURATION_FOR_LOGGING_MS}. * @param header Header string to print above the marker log. */ public synchronized void finish(String header) { mFinished = true; long duration = getTotalDuration(); if (duration <= MIN_DURATION_FOR_LOGGING_MS) { return; } long prevTime = mMarkers.get(0).time; d("(%-4d ms) %s", duration, header); for (Marker marker : mMarkers) { long thisTime = marker.time; d("(+%-4d) [%2d] %s", (thisTime - prevTime), marker.thread, marker.name); prevTime = thisTime; } }
/** * Closes the log, dumping it to logcat if the time difference between * the first and last markers is greater than {@link #MIN_DURATION_FOR_LOGGING_MS}. * @param header Header string to print above the marker log. */ public synchronized void finish(String header) { mFinished = true; long duration = getTotalDuration(); if (duration <= MIN_DURATION_FOR_LOGGING_MS) { return; } long prevTime = mMarkers.get(0).time; d("(%-4d ms) %s", duration, header); for (Marker marker : mMarkers) { long thisTime = marker.time; d("(+%-4d) [%2d] %s", (thisTime - prevTime), marker.thread, marker.name); prevTime = thisTime; } }
/** * Closes the log, dumping it to logcat if the time difference between * the first and last markers is greater than {@link #MIN_DURATION_FOR_LOGGING_MS}. * @param header Header string to print above the marker log. */ public synchronized void finish(String header) { mFinished = true; long duration = getTotalDuration(); if (duration <= MIN_DURATION_FOR_LOGGING_MS) { return; } long prevTime = mMarkers.get(0).time; d("(%-4d ms) %s", duration, header); for (Marker marker : mMarkers) { long thisTime = marker.time; d("(+%-4d) [%2d] %s", (thisTime - prevTime), marker.thread, marker.name); prevTime = thisTime; } }
/** * Closes the log, dumping it to logcat if the time difference between * the first and last markers is greater than {@link #MIN_DURATION_FOR_LOGGING_MS}. * @param header Header string to print above the marker log. */ public synchronized void finish(String header) { mFinished = true; long duration = getTotalDuration(); if (duration <= MIN_DURATION_FOR_LOGGING_MS) { return; } long prevTime = mMarkers.get(0).time; d("(%-4d ms) %s", duration, header); for (Marker marker : mMarkers) { long thisTime = marker.time; d("(+%-4d) [%2d] %s", (thisTime - prevTime), marker.thread, marker.name); prevTime = thisTime; } }