File tree Expand file tree Collapse file tree
src/main/java/eu/openanalytics/containerproxy/stat Expand file tree Collapse file tree Original file line number Diff line number Diff line change 227227 <artifactId >monetdb-jdbc</artifactId >
228228 <version >2.28</version >
229229 </dependency >
230+ <dependency >
231+ <groupId >com.microsoft.sqlserver</groupId >
232+ <artifactId >mssql-jdbc</artifactId >
233+ </dependency >
234+ <dependency >
235+ <groupId >org.postgresql</groupId >
236+ <artifactId >postgresql</artifactId >
237+ </dependency >
238+ <dependency >
239+ <groupId >mysql</groupId >
240+ <artifactId >mysql-connector-java</artifactId >
241+ </dependency >
242+
243+
230244
231245 <!-- Kubernetes -->
232246 <dependency >
Original file line number Diff line number Diff line change 3434import eu .openanalytics .containerproxy .service .EventService ;
3535import eu .openanalytics .containerproxy .service .EventService .Event ;
3636import eu .openanalytics .containerproxy .stat .impl .InfluxDBCollector ;
37- import eu .openanalytics .containerproxy .stat .impl .MonetDBCollector ;
37+ import eu .openanalytics .containerproxy .stat .impl .JDBCCollector ;
3838
3939@ Service
4040public class StatCollectorRegistry implements Consumer <Event > {
@@ -76,8 +76,8 @@ private IStatCollector findCollector(String baseURL) {
7676 if (baseURL == null || baseURL .isEmpty ()) return null ;
7777 if (baseURL .toLowerCase ().contains ("/write?db=" )) {
7878 return new InfluxDBCollector ();
79- } else if (baseURL .toLowerCase ().startsWith ("jdbc:monetdb " )) {
80- return new MonetDBCollector ();
79+ } else if (baseURL .toLowerCase ().startsWith ("jdbc" )) {
80+ return new JDBCCollector ();
8181 }
8282 return null ;
8383 }
Original file line number Diff line number Diff line change 3333import eu .openanalytics .containerproxy .stat .IStatCollector ;
3434
3535/**
36- * E.g.:
36+ *
37+ * # MonetDB, Postgresql, MySQL/MariaDB
3738 * usage-stats-url: jdbc:monetdb://localhost:50000/usage_stats
39+ * usage-stats-url: jdbc:postgresql://localhost/postgres
40+ * usage-stats-url: jdbc:mysql://localhost/shinyproxy
3841 *
3942 * Assumed table layout:
4043 *
4346 * username varchar(128),
4447 * type varchar(128),
4548 * data text
49+ * );
50+ *
51+ *
52+ * # MS SQL Server
53+ * usage-stats-url: jdbc:sqlserver://localhost;databaseName=shinyproxy
54+ *
55+ * Assumed table layout:
56+ *
57+ * create table event(
58+ * event_time datetime,
59+ * username varchar(128),
60+ * type varchar(128),
61+ * data text
4662 * );
4763 *
4864 */
49- public class MonetDBCollector implements IStatCollector {
65+ public class JDBCCollector implements IStatCollector {
5066
5167 @ Override
5268 public void accept (Event event , Environment env ) throws IOException {
You can’t perform that action at this time.
0 commit comments