[Schmitzm-commits] r1864 - in trunk: schmitzm-core/src/main/java/de/schmitzm/swing schmitzm-db/src/main/java/de/schmitzm/postgres

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Sat Feb 11 01:51:53 CET 2012


Author: alfonx
Date: 2012-02-11 01:51:52 +0100 (Sat, 11 Feb 2012)
New Revision: 1864

Modified:
   trunk/schmitzm-core/src/main/java/de/schmitzm/swing/AtlasDialog.java
   trunk/schmitzm-db/src/main/java/de/schmitzm/postgres/PGUtil.java
   trunk/schmitzm-db/src/main/java/de/schmitzm/postgres/SqlQueryStat.java
Log:
SqlQueryStat mit mehr Infos

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/AtlasDialog.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/AtlasDialog.java	2012-02-10 17:36:50 UTC (rev 1863)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/AtlasDialog.java	2012-02-11 00:51:52 UTC (rev 1864)
@@ -23,6 +23,7 @@
  */
 public class AtlasDialog extends JDialog {
 
+	private static final long serialVersionUID = -2260216314582952299L;
 	protected OkButton okButton;
 	protected CancelButton cancelButton;
 

Modified: trunk/schmitzm-db/src/main/java/de/schmitzm/postgres/PGUtil.java
===================================================================
--- trunk/schmitzm-db/src/main/java/de/schmitzm/postgres/PGUtil.java	2012-02-10 17:36:50 UTC (rev 1863)
+++ trunk/schmitzm-db/src/main/java/de/schmitzm/postgres/PGUtil.java	2012-02-11 00:51:52 UTC (rev 1864)
@@ -884,7 +884,7 @@
 			where += " and age (now(),query_start) >= interval '" + minSecondsRunning + " second' ";
 		}
 
-		final String sql = "select current_query, age (now(),query_start) as qage, waiting, procpid from pg_stat_activity "
+		final String sql = "select current_query, age (now(),query_start) as qage, waiting, procpid, client_addr, username, application_name from pg_stat_activity "
 				+ where + " order by qage desc";
 		ResultSet rs = c.createStatement().executeQuery(sql);
 
@@ -894,8 +894,11 @@
 				String age = rs.getString(2);
 				boolean waiting = rs.getBoolean(3);
 				Long procId = rs.getLong(4);
+				String client_addr = rs.getString(5);
+				String username = rs.getString(6);
+				String application_name = rs.getString(7);
 
-				result.add(new SqlQueryStat(q, new PGInterval(age), waiting, procId));
+				result.add(new SqlQueryStat(q, new PGInterval(age), waiting, procId, client_addr, username, application_name));
 			}
 
 		} finally {

Modified: trunk/schmitzm-db/src/main/java/de/schmitzm/postgres/SqlQueryStat.java
===================================================================
--- trunk/schmitzm-db/src/main/java/de/schmitzm/postgres/SqlQueryStat.java	2012-02-10 17:36:50 UTC (rev 1863)
+++ trunk/schmitzm-db/src/main/java/de/schmitzm/postgres/SqlQueryStat.java	2012-02-11 00:51:52 UTC (rev 1864)
@@ -13,11 +13,17 @@
 
 	final static Logger log = Logger.getLogger(SqlQueryStat.class);
 	private final boolean waiting;
+	private final String client_addr;
+	private final String username;
+	private final String application_name;
 
-	public SqlQueryStat(String query, String interval, boolean waiting, Long procId) {
+	public SqlQueryStat(String query, String interval, boolean waiting, Long procId, String client_addr, String username, String application_name) {
 		this.query = query;
 		this.waiting = waiting;
 		this.procId = procId;
+		this.client_addr = client_addr;
+		this.username = username;
+		this.application_name = application_name;
 		PGInterval runningFor_;
 		try {
 			runningFor_ = new PGInterval(interval);
@@ -28,11 +34,14 @@
 		runningFor = runningFor_;
 	}
 
-	public SqlQueryStat(String query, PGInterval interval, boolean waiting, Long procId) {
+	public SqlQueryStat(String query, PGInterval interval, boolean waiting, Long procId, String client_addr, String username, String application_name) {
 		this.query = query;
 		this.waiting = waiting;
 		this.procId = procId;
 		this.runningFor = interval;
+		this.client_addr = client_addr;
+		this.username = username;
+		this.application_name = application_name;
 	}
 
 	public PGInterval getRunningFor() {
@@ -68,4 +77,16 @@
 		return PGUtil.pg_terminate_backend(dbc, procId);
 	}
 
+	public String getClient_addr() {
+		return client_addr;
+	}
+
+	public String getUsername() {
+		return username;
+	}
+
+	public String getApplication_name() {
+		return application_name;
+	}
+
 }



More information about the Schmitzm-commits mailing list