play1 framework 유틸리티는 문서로 잘 설명되어 있지 않다.

이럴 때를 위해 play help 명령어를 실행한다.


$ play help

~        _            _

~  _ __ | | __ _ _  _| |

~ | '_ \| |/ _' | || |_|

~ |  __/|_|\____|\__ (_)

~ |_|            |__/

~

~ play! 1.4.2, https://www.playframework.com

~

~ For all commands, if the application is not specified, the current directory is used

~ Use 'play help cmd' to get more help on a specific command

~

~ Core commands:

~ ~~~~~~~~~~~~~~

~ antify          Create a build.xml file for this project

~ autotest        Automatically run all application tests

~ build-module    Build and package a module

~ check           Check for a release newer than the current one

~ classpath       Display the computed classpath

~ clean           Delete temporary files (including the bytecode cache)

~ dependencies    Resolve and retrieve project dependencies

~ eclipsify       Create all Eclipse configuration files

~ evolutions      Run the evolution check

~ evolutions:applyAutomatically apply pending evolutions

~ evolutions:markAppliedMark pending evolutions as manually applied

~ evolutions:resolveResolve partially applied evolution

~ help            Display help on a specific command

~ id              Define the framework ID

~ idealize        Create all IntelliJ Idea configuration files

~ install         Install a module

~ javadoc         Generate your application Javadoc

~ list-modules    List modules available from the central modules repository

~ modules         Display the computed modules list

~ netbeansify     Create all NetBeans configuration files

~ new             Create a new application

~ new-module      Create a module

~ out             Follow logs/system.out file

~ pid             Show the PID of the running application

~ precompile      Precompile all Java sources and templates to speed up application start-up

~ restart         Restart the running application

~ run             Run the application in the current shell

~ secret          Generate a new secret key

~ start           Start the application in the background

~ status          Display the running application's status

~ stop            Stop the running application

~ test            Run the application in test mode in the current shell

~ version         Print the framework version

~ war             Export the application as a standalone WAR archive

~

~ Also refer to documentation at https://www.playframework.com/documentation



status가 궁금하다면, 다음 명령어를 사용한다.


$ play help status

~        _            _

~  _ __ | | __ _ _  _| |

~ | '_ \| |/ _' | || |_|

~ |  __/|_|\____|\__ (_)

~ |_|            |__/

~

~ play! 1.4.2, https://www.playframework.com

~

~ Name:

~ ~~~~~

~ status -- Display the running application's status

~

~ Alias:

~ ~~~~~

~ st

~

~ Synopsis:

~ ~~~~~~~~~

~ play status [app_path] [--url=http://...] [--secret=...]

~

~ Description:

~ ~~~~~~~~~~~~

~ This script tries to connect to the running application's /@status URL to request the application status.

~ The application status contains useful informations about the running application.

~

~ The status command is aimed at monitoring applications running on production servers.

~

~ Options:

~ ~~~~~~~~

~ --url:

~ The script try to connect to the application at the localhost domain. If you want to monitor an application running on

~ a remote server, specify the application URL using this option (eg. play status --url=http://myapp.com)

~

~ --secret:

~ The script uses the secret key to generate an authorization token. It assumes that the secret key available from the

~ app_path/conf/application.conf is valid. If not you can provide your own secret key using this option

~ (eg. play status --secret=bghjT7ZG7ZGCO8)

~

~ If you provide both options, you can run this command without a local application directory (app_path is not required).

~


프로젝트 디렉토리에서 다음 커맨드를 실행한다.


$ play status --url=http://127.0.0.1:9000

~        _            _

~  _ __ | | __ _ _  _| |

~ | '_ \| |/ _' | || |_|

~ |  __/|_|\____|\__ (_)

~ |_|            |__/

~

~ play! 1.4.2, https://www.playframework.com

~

~ Status from http://127.0.0.1:19000/@status,

~

Java:

~~~~~

Version: 1.8.0_40

Home: /usr/java/jdk1.8.0_40/jre

Max memory: 438304768

Free memory: 36274240

Total memory: 233832448

Available processors: 2

Play framework:

~~~~~~~~~~~~~~~

Version: 1.4.2

Path: /usr/local/play-1.4.2

ID: beta

Mode: PROD

Tmp dir: xxxxxxx


Application:

~~~~~~~~~~~~

Path: xxxxx

Name: play-server

Started at: 06/13/2016 22:23


Loaded modules:

~~~~~~~~~~~~~~

spring at xxxxx


Loaded plugins:

~~~~~~~~~~~~~~

0:play.CorePlugin [enabled]

1:play.ConfigurationChangeWatcherPlugin [disabled]

10:play.modules.router.ext.YetAnotherRouterAnnotationsPlugin [enabled]

100:play.data.parsing.TempFilePlugin [enabled]

200:play.data.validation.ValidationPlugin [enabled]

300:play.db.DBPlugin [enabled]

400:play.db.jpa.JPAPlugin [enabled]

450:play.db.Evolutions [enabled]

500:play.i18n.MessagesPlugin [enabled]

600:play.libs.WS [enabled]

700:play.jobs.JobsPlugin [enabled]

1000:play.modules.spring.SpringPlugin [enabled]

100000:play.plugins.ConfigurablePluginDisablingPlugin [enabled]

Threads:
~~~~~~~~
Thread[Reference Handler,10,system] WAITING
Thread[Finalizer,8,system] WAITING
Thread[Signal Dispatcher,9,system] RUNNABLE
Thread[RMI TCP Accept-0,5,system] RUNNABLE
Thread[RMI TCP Accept-19100,5,system] RUNNABLE
Thread[RMI TCP Accept-0,5,system] RUNNABLE
......
Thread[nifty-client-worker-2,5,main] RUNNABLE
Thread[nifty-client-worker-3,5,main] RUNNABLE

Requests execution pool:
~~~~~~~~~~~~~~~~~~~~~~~~
Pool size: 256
Active count: 0
Scheduled task count: 1936
Queue size: 0

Monitors:

~~~~~~~~

AController.list()                             ->      121 hits;    226.6 avg;    116.0 min;    707.0 max;

........


Jobs execution pool:

~~~~~~~~~~~~~~~~~~~

Pool size: 0

Active count: 0

Scheduled task count: 0

Queue size: 0




만약 play 커맨드를 알고 싶다면, 다음 소스를 살펴본다.


https://github.com/playframework/play1/tree/master/framework/pym/play/commands


만약 status에 대해서 깊이 알고 싶다면,

CorePlugin.java와  https://github.com/playframework/play1/blob/master/framework/pym/play/commands/status.py를 살펴본다.

실제 url이  url = 'http://localhost:%s/@status' % http_port 인 것을 볼 수 있다.



Posted by '김용환'
,