forked from jbossas/console
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
begin work on transaction metrics (POC)
- Loading branch information
1 parent
db9d25e
commit bb07792
Showing
11 changed files
with
187 additions
and
14 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
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
86 changes: 86 additions & 0 deletions
86
gui/src/main/java/org/jboss/as/console/client/shared/runtime/TXMetricView.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,86 @@ | ||
package org.jboss.as.console.client.shared.runtime; | ||
|
||
import com.google.gwt.dom.client.Style; | ||
import com.google.gwt.event.dom.client.ClickEvent; | ||
import com.google.gwt.event.dom.client.ClickHandler; | ||
import com.google.gwt.user.client.ui.LayoutPanel; | ||
import com.google.gwt.user.client.ui.ScrollPanel; | ||
import com.google.gwt.user.client.ui.VerticalPanel; | ||
import com.google.gwt.user.client.ui.Widget; | ||
import org.jboss.as.console.client.Console; | ||
import org.jboss.as.console.client.core.SuspendableViewImpl; | ||
import org.jboss.as.console.client.shared.subsys.tx.TXExecutionView; | ||
import org.jboss.as.console.client.shared.subsys.tx.TXRollbackView; | ||
import org.jboss.as.console.client.shared.subsys.tx.model.RollbackMetric; | ||
import org.jboss.as.console.client.shared.subsys.tx.model.TXMetric; | ||
import org.jboss.as.console.client.standalone.runtime.TXMetricPresenter; | ||
import org.jboss.ballroom.client.widgets.tabs.FakeTabPanel; | ||
import org.jboss.ballroom.client.widgets.tools.ToolButton; | ||
import org.jboss.ballroom.client.widgets.tools.ToolStrip; | ||
|
||
/** | ||
* @author Heiko Braun | ||
* @date 11/3/11 | ||
*/ | ||
public class TXMetricView extends SuspendableViewImpl implements TXMetricPresenter.MyView{ | ||
|
||
private TXMetricPresenter presenter; | ||
private TXExecutionView executionMetric; | ||
private TXRollbackView rollbackMetric; | ||
|
||
|
||
@Override | ||
public void setPresenter(TXMetricPresenter presenter) { | ||
this.presenter = presenter; | ||
} | ||
|
||
@Override | ||
public Widget createWidget() { | ||
|
||
LayoutPanel layout = new LayoutPanel(); | ||
|
||
FakeTabPanel titleBar = new FakeTabPanel("Transaction Metrics"); | ||
layout.add(titleBar); | ||
|
||
// ---- | ||
|
||
final ToolStrip toolStrip = new ToolStrip(); | ||
|
||
toolStrip.addToolButtonRight(new ToolButton(Console.CONSTANTS.common_label_refresh(), new ClickHandler(){ | ||
@Override | ||
public void onClick(ClickEvent event) { | ||
|
||
} | ||
})); | ||
|
||
|
||
layout.add(toolStrip); | ||
|
||
// --- | ||
|
||
VerticalPanel panel = new VerticalPanel(); | ||
panel.setStyleName("rhs-content-panel"); | ||
|
||
ScrollPanel scrollPanel = new ScrollPanel(panel); | ||
layout.add(scrollPanel); | ||
|
||
layout.setWidgetTopHeight(titleBar, 0, Style.Unit.PX, 28, Style.Unit.PX); | ||
layout.setWidgetTopHeight(toolStrip, 28, Style.Unit.PX, 30, Style.Unit.PX); | ||
layout.setWidgetTopHeight(scrollPanel, 58, Style.Unit.PX, 100, Style.Unit.PCT); | ||
|
||
// -------------- | ||
|
||
this.executionMetric = new TXExecutionView(); | ||
panel.add(executionMetric.asWidget()); | ||
|
||
this.rollbackMetric = new TXRollbackView(); | ||
panel.add(rollbackMetric.asWidget()); | ||
|
||
|
||
// sample data | ||
executionMetric.addSample(new TXMetric(55, 12, 33, 5)); | ||
rollbackMetric.addSample(new RollbackMetric(77, 12)); | ||
|
||
return layout; | ||
} | ||
} |
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
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
57 changes: 57 additions & 0 deletions
57
gui/src/main/java/org/jboss/as/console/client/standalone/runtime/TXMetricPresenter.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,57 @@ | ||
package org.jboss.as.console.client.standalone.runtime; | ||
|
||
import com.google.gwt.event.shared.EventBus; | ||
import com.google.inject.Inject; | ||
import com.gwtplatform.mvp.client.Presenter; | ||
import com.gwtplatform.mvp.client.View; | ||
import com.gwtplatform.mvp.client.annotations.NameToken; | ||
import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit; | ||
import com.gwtplatform.mvp.client.proxy.Place; | ||
import com.gwtplatform.mvp.client.proxy.PlaceManager; | ||
import com.gwtplatform.mvp.client.proxy.Proxy; | ||
import com.gwtplatform.mvp.client.proxy.RevealContentEvent; | ||
import org.jboss.as.console.client.core.NameTokens; | ||
import org.jboss.as.console.client.standalone.ServerMgmtApplicationPresenter; | ||
|
||
/** | ||
* @author Heiko Braun | ||
* @date 11/3/11 | ||
*/ | ||
public class TXMetricPresenter extends Presenter<TXMetricPresenter.MyView, TXMetricPresenter.MyProxy> { | ||
|
||
private final PlaceManager placeManager; | ||
|
||
@ProxyCodeSplit | ||
@NameToken(NameTokens.TXMetrics) | ||
public interface MyProxy extends Proxy<TXMetricPresenter>, Place { | ||
} | ||
|
||
public interface MyView extends View { | ||
void setPresenter(TXMetricPresenter presenter); | ||
} | ||
|
||
@Inject | ||
public TXMetricPresenter(EventBus eventBus, MyView view, MyProxy proxy, | ||
PlaceManager placeManager) { | ||
super(eventBus, view, proxy); | ||
|
||
this.placeManager = placeManager; | ||
} | ||
|
||
@Override | ||
protected void onBind() { | ||
super.onBind(); | ||
getView().setPresenter(this); | ||
} | ||
|
||
|
||
@Override | ||
protected void onReset() { | ||
super.onReset(); | ||
} | ||
|
||
@Override | ||
protected void revealInParent() { | ||
RevealContentEvent.fire(getEventBus(), StandaloneRuntimePresenter.TYPE_MainContent, this); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -55,4 +55,4 @@ | |
padding-left: 0; | ||
padding-right: 0; | ||
width: 100%; | ||
} | ||
} |