-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #789 from parallaxinc/demo
Version 0.93 251
- Loading branch information
Showing
87 changed files
with
2,330 additions
and
743 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* | ||
* Add coach email address field to support email cc option. | ||
*/ | ||
ALTER TABLE user ADD COLUMN coach_email VARCHAR(250) AFTER screen_name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/com/parallax/server/blocklyprop/enums/ConfirmPage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package com.parallax.server.blocklyprop.enums; | ||
|
||
/** | ||
* | ||
* @author Michel | ||
*/ | ||
public enum ConfirmPage { | ||
|
||
ALREADY_CONFIRMED("already-confirmed"), | ||
CONFIRM_REQUESTED("confirm-requested"), | ||
CONFIRMED("confirmed"); | ||
|
||
private final String page; | ||
|
||
private ConfirmPage(String page) { | ||
this.page = page; | ||
} | ||
|
||
public String getPage() { | ||
return page; | ||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/com/parallax/server/blocklyprop/enums/PasswordResetPage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package com.parallax.server.blocklyprop.enums; | ||
|
||
/** | ||
* | ||
* @author Michel | ||
*/ | ||
public enum PasswordResetPage { | ||
|
||
RESET_DONE("reset-done"), | ||
RESET_REQUESTED("reset-requested"); | ||
|
||
private final String page; | ||
|
||
private PasswordResetPage(String page) { | ||
this.page = page; | ||
} | ||
|
||
public String getPage() { | ||
return page; | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
.../parallax/server/blocklyprop/monitoring/BlocklyPropInstrumentedFilterContextListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package com.parallax.server.blocklyprop.monitoring; | ||
|
||
import com.codahale.metrics.MetricRegistry; | ||
import com.codahale.metrics.servlet.InstrumentedFilterContextListener; | ||
|
||
/** | ||
* | ||
* @author Michel | ||
*/ | ||
public class BlocklyPropInstrumentedFilterContextListener extends InstrumentedFilterContextListener { | ||
|
||
@Override | ||
protected MetricRegistry getMetricRegistry() { | ||
return Monitor.metrics(); | ||
} | ||
|
||
} |
83 changes: 83 additions & 0 deletions
83
src/main/java/com/parallax/server/blocklyprop/monitoring/Monitor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package com.parallax.server.blocklyprop.monitoring; | ||
|
||
import com.codahale.metrics.ConsoleReporter; | ||
import com.codahale.metrics.MetricFilter; | ||
import com.codahale.metrics.MetricRegistry; | ||
import com.codahale.metrics.graphite.GraphiteReporter; | ||
import com.codahale.metrics.graphite.PickledGraphite; | ||
import com.codahale.metrics.jvm.GarbageCollectorMetricSet; | ||
import com.codahale.metrics.jvm.MemoryUsageGaugeSet; | ||
import com.codahale.metrics.log4j.InstrumentedAppender; | ||
import com.google.inject.Inject; | ||
import com.google.inject.Singleton; | ||
import java.net.InetSocketAddress; | ||
import java.util.concurrent.TimeUnit; | ||
import org.apache.commons.configuration.Configuration; | ||
import org.apache.log4j.LogManager; | ||
|
||
/** | ||
* | ||
* @author Michel | ||
*/ | ||
@Singleton | ||
public class Monitor { | ||
|
||
private static final MetricRegistry metrics = new MetricRegistry(); | ||
|
||
private final boolean consoleEnabled; | ||
private final int consoleReportingInterval; | ||
|
||
private final boolean graphiteEnabled; | ||
private final String graphitePrefix; | ||
private final String graphiteServerAddress; | ||
private final int graphiteServerPort; | ||
private final int graphiteReportingInterval; | ||
|
||
@Inject | ||
public Monitor(Configuration configuration) { | ||
consoleEnabled = configuration.getBoolean("monitor.console.enabled", false); | ||
consoleReportingInterval = configuration.getInt("monitor.console.interval", 300); | ||
|
||
graphiteEnabled = configuration.getBoolean("monitor.graphite.enabled", false); | ||
graphitePrefix = configuration.getString("monitor.graphite.prefix", "blocklyprop"); | ||
graphiteServerAddress = configuration.getString("monitor.graphite.address", "localhost"); | ||
graphiteServerPort = configuration.getInt("monitor.graphite.port", 2003); | ||
graphiteReportingInterval = configuration.getInt("monitor.graphite.interval", 30); | ||
|
||
init(); | ||
} | ||
|
||
private void init() { | ||
if (consoleEnabled) { | ||
ConsoleReporter reporter = ConsoleReporter.forRegistry(metrics).convertDurationsTo(TimeUnit.MILLISECONDS).build(); | ||
reporter.start(consoleReportingInterval, TimeUnit.SECONDS); | ||
} | ||
|
||
if (graphiteEnabled) { | ||
final PickledGraphite pickledGraphite = new PickledGraphite(new InetSocketAddress(graphiteServerAddress, graphiteServerPort)); | ||
final GraphiteReporter graphiteReporter = GraphiteReporter.forRegistry(metrics).prefixedWith(graphitePrefix).convertDurationsTo(TimeUnit.MILLISECONDS).filter(MetricFilter.ALL).build(pickledGraphite); | ||
graphiteReporter.start(graphiteReportingInterval, TimeUnit.SECONDS); | ||
} | ||
|
||
InstrumentedAppender appender = new InstrumentedAppender(metrics); | ||
appender.activateOptions(); | ||
|
||
LogManager.getRootLogger().addAppender(appender); | ||
|
||
MemoryUsageGaugeSet memoryUsageGaugeSet = new MemoryUsageGaugeSet(); | ||
metrics.registerAll(memoryUsageGaugeSet); | ||
|
||
GarbageCollectorMetricSet garbageCollectorMetricSet = new GarbageCollectorMetricSet(); | ||
metrics.registerAll(garbageCollectorMetricSet); | ||
} | ||
|
||
public static MetricRegistry metrics() { | ||
return metrics; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.