#1824 Adds diagnostic report generation to File>>Reports menu to log thread dumps and generate a processing diagnostic/status report. (#1825)

Co-authored-by: Dennis Sheirer <dsheirer@github.com>
This commit is contained in:
Denny Sheirer
2024-02-04 09:59:53 -05:00
committed by GitHub
parent 3acaea0019
commit 7b9adc1da2
12 changed files with 501 additions and 73 deletions

View File

@@ -1,7 +1,6 @@
/*
* ******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2018 Dennis Sheirer
* *****************************************************************************
* Copyright (C) 2014-2024 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* *****************************************************************************
* ****************************************************************************
*/
package io.github.dsheirer.util;
@@ -26,8 +25,9 @@ public class TimeStamp
{
public static SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyyMMdd");
public static SimpleDateFormat TIME_FORMAT = new SimpleDateFormat("HHmmss");
public static SimpleDateFormat DATE_WITH_MILLISECONDS_FORMAT = new SimpleDateFormat("HHmmss.SSS");
public static SimpleDateFormat TIME_WITH_MILLISECONDS_FORMAT = new SimpleDateFormat("HHmmss.SSS");
public static SimpleDateFormat DATE_TIME_FORMAT = new SimpleDateFormat("yyyy:MM:dd HH:mm:ss");
public static SimpleDateFormat DATE_TIME_FORMAT_FILE = new SimpleDateFormat("yyyyMMdd_HHmmss");
public static SimpleDateFormat DATE_TIME_MILLIS_FORMAT = new SimpleDateFormat("yyyyMMdd HHmmss.SSS");
/**
@@ -46,6 +46,44 @@ public class TimeStamp
return DATE_FORMAT.format(new Date(timestamp));
}
/**
* Date time formatted for use in a file.
* @param timestamp to format
* @return format string
*/
public static String getFileFormattedDateTime(long timestamp)
{
return DATE_TIME_FORMAT_FILE.format(new Date(timestamp));
}
/**
* Current date and time formatted for use in a file.
* @return format string
*/
public static String getFileFormattedDateTime()
{
return getFileFormattedDateTime(System.currentTimeMillis());
}
/**
* Creates formatted date and timestamp
* @param timestamp to format
* @return formatted date and time
*/
public static String getFormattedDateTime(long timestamp)
{
return DATE_TIME_FORMAT.format(new Date(timestamp));
}
/**
* Creates formatted date and timestamp using now as the timestamp.
* @return formatted date and time
*/
public static String getFormattedDateTime()
{
return getFormattedDateTime(System.currentTimeMillis());
}
/**
* Returns the current system time formatted as HH:mm:ss
*/
@@ -67,7 +105,7 @@ public class TimeStamp
*/
public static synchronized String getFormattedTimeWithMilliseconds(long timestamp)
{
return DATE_WITH_MILLISECONDS_FORMAT.format(new Date(timestamp));
return TIME_WITH_MILLISECONDS_FORMAT.format(new Date(timestamp));
}
/**