This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 77aa8636c577e6582708edd41ccc791fab2557c3
Merge: 5f3d3b0 7dccf95
Author: Stephen Mallette <[email protected]>
AuthorDate: Mon Oct 25 08:11:30 2021 -0400

    Merge branch '3.4-dev' into 3.5-dev

 docs/src/reference/gremlin-applications.asciidoc | 49 ++++++++++++++++--------
 1 file changed, 34 insertions(+), 15 deletions(-)

diff --cc docs/src/reference/gremlin-applications.asciidoc
index 5372e12,ecd11b2..eb6c4df
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@@ -1086,221 -1076,23 +1087,240 @@@ method for processing script evaluatio
  ===== TraversalOpProcessor
  
  The `TraversalOpProcessor` provides a way to accept traversals configured via 
<<connecting-via-drivers,withRemote()>>.
 +It has no special configuration settings.
 +
 +==== Serialization
 +
 +Gremlin Server can accept requests and return results using different 
serialization formats. Serializers implement the
 +`MessageSerializer` interface. In doing so, they express the list of mime 
types they expect to support. When
 +configuring multiple serializers it is possible for two or more serializers 
to support the same mime type. Such a
 +situation may be common with a generic mime type such as `application/json`. 
Serializers are added in the order that
 +they are encountered in the configuration file and the first one added for a 
specific mime type will not be overridden
 +by other serializers that also support it.
 +
 +The format of the serialization is configured by the `serializers` setting 
described in the table above.  Note that
 +some serializers have additional configuration options as defined by the 
`serializers[X].config` setting.  The
 +`config` setting is a `Map` where the keys and values get passed to the 
serializer at its initialization.  The
 +available and/or expected keys are dependent on the serializer being used.  
Gremlin Server comes packaged with three
 +different serializers: GraphSON, Gryo, and GraphBinary (however, GraphSON and 
GraphBinary are the only two configured
 +by default).
 +
 +===== GraphSON
 +
 +The GraphSON serializer produces human readable output in JSON format and is 
a good configuration choice for those
 +trying to use TinkerPop from non-JVM languages.  JSON obviously has wide 
support across virtually all major
 +programming languages and can be consumed by a wide variety of tools. The 
format itself is described in the
 +link:https://tinkerpop.apache.org/docs/current/dev/io/#graphson[IO 
Documentation].
 +
 +[source,yaml]
 +----
-   - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0 }
-   - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0 }
++  - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0 }
 +----
 +
- The above configuration represents the default serialization under the 
`application/json` MIME type and produces JSON
- consistent with standard JSON data types.  It has the following configuration 
option:
++Gremlin Server is configured by default with GraphSON 3.0 as shown above. It 
has the following configuration option:
  
  [width="100%",cols="3,10,^2",options="header"]
  |=========================================================
 -|Name |Description |Default
 -|cacheExpirationTime |Time in milliseconds before side-effects from a 
`Traversal` will be evicted. |60000
 -|cacheMaxSize |The maximum number of entries in the side-effect cache. |1000
 +|Key |Description |Default
 +|ioRegistries |A list of `IoRegistry` implementations to be applied to the 
serializer. |_none_
 +|=========================================================
 +
++It is worth noting that GraphSON 1.0 still has some appeal for some users as 
it can be configured to produce an untyped
++JSON format which is a bit easier to consume than its successors which embed 
data types into the output. This version
++of GraphSON tends to be the one that users like to utilize when 
<<connecting-via-http,connecting via HTTP>> and is still
++used by some <<connecting-rgp, Remote Gremlin Providers>> for this purpose.
++
++To configure Gremlin Server this way, the `GraphSONMessageSerializerV1d0` 
must be included:
++
 +[source,yaml]
-   - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0 }
++----
++  - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0 }
++  - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0 }
++----
 +
- When the standard JSON data types are not enough (e.g. need to identify the 
difference between `double` and `float`
- data types), the above configuration will embed types into the JSON itself.  
The type embedding uses standard Java
- type names, so interpretation from non-JVM languages will be required.  It 
has the MIME type of
- `application/vnd.gremlin-v1.0+json` and the following configuration options:
++In the above situation, both `GraphSONMessageSerializerV1d0` and 
`GraphSONMessageSerializerV3d0` each bind to the
++`application/json` mime type. When such conflicts arise, Gremlin Server will 
use the order of the serializers to
++determine priority such that the first serializer to bind to a type will be 
used and the others ignored. The following
++log message will indicate how the server is ultimately configured:
 +
- [width="100%",cols="3,10,^2",options="header"]
- |=========================================================
- |Key |Description |Default
- |ioRegistries |A list of `IoRegistry` implementations to be applied to the 
serializer. |_none_
- |=========================================================
++[source,text]
++----
++[INFO] AbstractChannelizer - Configured application/json with 
org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0
++[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+json 
with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0
++[INFO] AbstractChannelizer - application/json already has 
org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0 
configured - it will not be replaced by 
org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, change 
order of serialization configuration if this is not desired.
++----
++
++Given the above, using GraphSON 3.0 under this configuration will require 
that the user specific the type:
++
++[source,text]
++----
++$ curl -X POST -d "{\"gremlin\":\"100-1\"}" "http://localhost:8182";
++{"requestId":"f8720ad9-2c8b-4eef-babe-21792a3e3157","status":{"message":"","code":200,"attributes":{}},"result":{"data":[99],"meta":{}}}
++$ curl -H "Accept:application/vnd.gremlin-v3.0+json" -X POST -d 
"{\"gremlin\":\"100-1\"}" "http://localhost:8182";
++{"requestId":"9fdf0892-d86c-41f2-94b5-092785c473eb","status":{"message":"","code":200,"attributes":{"@type":"g:Map","@value":[]}},"result":{"data":{"@type":"g:List","@value":[{"@type":"g:Int32","@value":99}]},"meta":{"@type":"g:Map","@value":[]}}
++----
 +
 +===== Gryo
 +
 +WARNING: Gryo is no longer the recommended serialization format for Gremlin 
Server. Consider using
 +<<server-graphbinary, GraphBinary>> instead.
 +
 +The Gryo serializer utilizes Kryo-based serialization which produces a binary 
output.  This format is best consumed
 +by JVM-based languages. The format itself is described in the
 +link:https://tinkerpop.apache.org/docs/current/dev/io/#gryo[IO Documentation].
 +
 +[source,yaml]
 +  - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerGremlinV3d0 }
 +
 +It has the MIME type of `application/vnd.gremlin-v3.0+gryo` and the following 
configuration options:
 +
 +[width="100%",cols="3,10,^2",options="header"]
 +|=========================================================
 +|Key |Description |Default
 +|bufferSize |The maximum size of the Kryo buffer for use on a single object 
being serialized.  Increasing this value will correct `KryoException` errors 
that complain of "Buffer too small". |_4096_
 +|classResolverSupplier |The fully qualified classname of a custom 
`Supplier<ClassResolver>` which will be used when constructing `Kryo` 
instances. There is no direct default for this setting, but without a setting 
the `GryoClassResolver` is used. |_none_
 +|custom |A list of classes with custom kryo `Serializer` implementations 
related to them in the form of `<class>;<serializer-class>`. |_none_
 +|ioRegistries |A list of `IoRegistry` implementations to be applied to the 
serializer. |_none_
 +|serializeResultToString |When set to `true`, results are serialized by first 
calling `toString()` on each object in the result list resulting in an extended 
MIME Type of `application/vnd.gremlin-v1.0+gryo-stringd`.  When set to `false` 
Kryo-based serialization is applied. |_false_
  |=========================================================
  
 -If there is no intention to gather side-effects from traversals, the 
`cacheMaxSize` can be set to zero to disable the
 -cache.
 +As described above, there are multiple ways in which to register serializers 
for Kryo-based serialization.  Note
 +that the `ioRegistries` setting is applied first, followed by the `custom` 
setting.
 +
 +Those configuring or implementing a `Supplier<ClassResolver>` should consider 
this an "advanced" option and typically
 +important to use cases where server types need to be coerced to client types 
(i.e. a type is available on the server
 +but not on the client).  Implementations should typically instantiate 
`ClassResolver` implementations that are
 +extensions of the `GryoClassResolver` as this class is important to most 
serialization tasks in TinkerPop.
 +
 +[[server-graphbinary]]
 +===== GraphBinary
 +
 +GraphBinary is a binary serialization format suitable for object trees, 
designed to reduce serialization overhead on
 +both the client and the server, as well as limiting the size of the payload 
that is transmitted over the wire. The
 +format itself is described in the 
link:https://tinkerpop.apache.org/docs/current/dev/io/#graphbinary[IO 
Documentation].
 +
 +[source,yaml]
 +  - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1 }
 +
 +It has the MIME type of `application/vnd.graphbinary-v1.0` and the following 
configuration options:
 +
 +[width="100%",cols="3,10,^2",options="header"]
 +|=========================================================
 +|Key |Description |Default
 +|custom |A list of classes with custom kryo `Serializer` implementations 
related to them in the form of `<class>;<serializer-class>`. |_none_
 +|ioRegistries |A list of `IoRegistry` implementations to be applied to the 
serializer. |_none_
 +|builder |Name of the `TypeSerializerRegistry.Builder` instance to be used to 
construct the `TypeSerializerRegistry`. |_none_
 +|=========================================================
 +
 +As described above, there are multiple ways in which to register serializers 
for GraphBinary-based serialization. Note
 +that the `ioRegistries` setting is applied first, followed by the `custom` 
setting.
 +
 +[[metrics]]
 +==== Metrics
 +
 +Gremlin Server produces metrics about its operations that can yield some 
insight into how it is performing. These
 +metrics are exposed in a variety of ways:
 +
 +* Directly to the console where Gremlin Server is running
 +* CSV file
 +* link:http://ganglia.info/[Ganglia]
 +* link:http://graphite.wikidot.com/[Graphite]
 +* link:http://www.slf4j.org/[SLF4j]
 +* link:https://en.wikipedia.org/wiki/Java_Management_Extensions[JMX]
 +
 +The configuration of each of these outputs is described in the Gremlin Server 
<<_configuring_2, Configuring>> section.
 +Note that Graphite and Ganglia are not included as part of the Gremlin Server 
distribution and must be installed
 +to the server manually.
 +
 +[source,text]
 +----
 +bin/gremlin-server.sh install com.codahale.metrics metrics-ganglia 3.0.2
 +bin/gremlin-server.sh install com.codahale.metrics metrics-graphite 3.0.2
 +----
 +
 +WARNING: Gremlin Server is built to work with Metrics 3.0.2. Usage of other 
versions may lead to unexpected problems.
 +
 +NOTE: Installing Ganglia will include `org.acplt:oncrpc`, which is an LGPL 
licensed dependency.
 +
 +Regardless of the output, the metrics gathered are the same. Each metric is 
prefixed with
 +`org.apache.tinkerpop.gremlin.server.GremlinServer` and the following metrics 
are reported:
 +
 +* `sessions` - The number of sessions open at the time the metric was last 
measured. For the `UnifiedChannelizer`, each
 +request creates a "session", even a so-called "sessionless request", which is 
basically a session that will only
 +execute within the context of that single request.
 +* `errors` - The number of total errors, mean rate, as well as the 1, 5, and 
15-minute error rates.
 +* `op.eval` - The number of script evaluations, mean rate, 1, 5, and 15 
minute rates, minimum, maximum, median, mean,
 +and standard deviation evaluation times, as well as the 75th, 95th, 98th, 
99th and 99.9th percentile evaluation times
 +(note that these time apply to both sessionless and in-session requests).
 +* `op.traversal` - The number of `Traversal` bytecode-based executions, mean 
rate, 1, 5, and 15 minute rates, minimum,
 +maximum, median, mean, and standard deviation evaluation times, as well as 
the 75th, 95th, 98th, 99th and 99.9th
 +percentile evaluation times.
 +* `engine-name.session.session-id.*` - Metrics related to different 
`GremlinScriptEngine` instances configured for
 +session-based requests where "engine-name" will be the actual name of the 
engine, such as "gremlin-groovy" and
 +"session-id" will be the identifier for the session itself. This metric is 
not measured under the `UnifiedChannelizer`.
 +* `engine-name.sessionless.*` - Metrics related to different 
`GremlinScriptEngine` instances configured for sessionless
 +requests where "engine-name" will be the actual name of the engine, such as 
"gremlin-groovy". This metric is not
 +measured under the `UnifiedChannelizer`.
 +
 +==== As A Service
 +
 +Gremlin server can be configured to run as a service.
 +
 +===== Init.d (SysV)
 +
 +Link `bin/gremlin-server.sh` to `init.d`
 +Be sure to set RUNAS to the service user in `bin/gremlin-server.conf`
 +
 +[source,bash]
 +----
 +# Install
 +ln -s /path/to/apache-tinkerpop-gremlin-server-x.y.z/bin/gremlin-server.sh 
/etc/init.d/gremlin-server
 +
 +# Systems with chkconfig/service. E.g. Fedora, Red Hat
 +chkconfig --add gremlin-server
 +
 +# Start
 +service gremlin-server start
 +
 +# Or call directly
 +/etc/init.d/gremlin-server restart
 +
 +----
 +
 +===== Systemd
 +
 +To install, copy the service template below to 
/etc/systemd/system/gremlin.service
 +and update the paths `/path/to/apache-tinkerpop-gremlin-server` with the 
actual install path of Gremlin Server.
 +
 +[source,bash]
 +----
 +[Unit]
 +Description=Apache TinkerPop Gremlin Server daemon
 +Documentation=https://tinkerpop.apache.org/
 +After=network.target
 +
 +[Service]
 +Type=forking
 +ExecStart=/path/to/apache-tinkerpop-gremlin-server/bin/gremlin-server.sh start
 +ExecStop=/path/to/apache-tinkerpop-gremlin-server/bin/gremlin-server.sh stop
 +PIDFile=/path/to/apache-tinkerpop-gremlin-server/run/gremlin.pid
 +
 +[Install]
 +WantedBy=multi-user.target
 +----
 +
 +
 +Enable the service with `systemctl enable gremlin-server`
 +
 +Start the service with `systemctl start gremlin-server`
 +
  
  [[security]]
 -==== Security
 +=== Security
  
  image:gremlin-server-secure.png[width=175,float=right] Gremlin Server 
provides for several features that aid in the
 -security of the graphs that it exposes.  In particular it supports SSL for 
transport layer security, protective
 -measures against malicious script execution, and authentication.  Client SSL 
options are described in the
 +security of the graphs that it exposes.  In particular it supports SSL for 
transport layer security, authentication,
 +authorization and protective measures against malicious script execution.  
Client SSL options are described in the
  <<gremlin-drivers-variants, Gremlin Drivers and Variants">> sections with 
varying capability depending on the driver
  chosen. Script execution options are covered <<script-execution, "at the end 
of this section">>. This section
  starts with authentication.
@@@ -2044,7 -1491,226 +2064,6 @@@ A final thought on the topic of `Groovy
  can fine tune the Groovy compilation process.  Read more about compilation 
customization in the
  
link:http://docs.groovy-lang.org/latest/html/documentation/#compilation-customizers[Groovy
 Documentation].
  
 -==== Serialization
 -
 -Gremlin Server can accept requests and return results using different 
serialization formats. Serializers implement the
 -`MessageSerializer` interface. In doing so, they express the list of mime 
types they expect to support. When
 -configuring multiple serializers it is possible for two or more serializers 
to support the same mime type. Such a
 -situation may be common with a generic mime type such as `application/json`. 
Serializers are added in the order that
 -they are encountered in the configuration file and the first one added for a 
specific mime type will not be overridden
 -by other serializers that also support it.
 -
 -The format of the serialization is configured by the `serializers` setting 
described in the table above.  Note that
 -some serializers have additional configuration options as defined by the 
`serializers[X].config` setting.  The
 -`config` setting is a `Map` where the keys and values get passed to the 
serializer at its initialization.  The
 -available and/or expected keys are dependent on the serializer being used.  
Gremlin Server comes packaged with three
 -different serializers: GraphSON, Gryo, and GraphBinary.
 -
 -===== GraphSON
 -
 -The GraphSON serializer produces human readable output in JSON format and is 
a good configuration choice for those
 -trying to use TinkerPop from non-JVM languages.  JSON obviously has wide 
support across virtually all major
 -programming languages and can be consumed by a wide variety of tools. The 
format itself is described in the
 -link:https://tinkerpop.apache.org/docs/current/dev/io/#graphson[IO 
Documentation].
 -
 -[source,yaml]
 -----
 -  - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0 }
 -----
 -
 -Gremlin Server is configured by default with GraphSON 3.0 as shown above. It 
has the following configuration option:
 -
 -[width="100%",cols="3,10,^2",options="header"]
 -|=========================================================
 -|Key |Description |Default
 -|ioRegistries |A list of `IoRegistry` implementations to be applied to the 
serializer. |_none_
 -|=========================================================
 -
 -It is worth noting that GraphSON 1.0 still has some appeal for some users as 
it can be configured to produce an untyped
 -JSON format which is a bit easier to consume than its successors which embed 
data types into the output. This version
 -of GraphSON tends to be the one that users like to utilize when 
<<connecting-via-http,connecting via HTTP>> and is still
 -used by some <<connecting-rgp, Remote Gremlin Providers>> for this purpose.
 -
 -To configure Gremlin Server this way, the `GraphSONMessageSerializerV1d0` 
must be included:
 -
 -[source,yaml]
 -----
 -  - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0 }
 -  - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0 }
 -----
 -
 -In the above situation, both `GraphSONMessageSerializerV1d0` and 
`GraphSONMessageSerializerV3d0` each bind to the
 -`application/json` mime type. When such conflicts arise, Gremlin Server will 
use the order of the serializers to
 -determine priority such that the first serializer to bind to a type will be 
used and the others ignored. The following
 -log message will indicate how the server is ultimately configured:
 -
 -[source,text]
 -----
 -[INFO] AbstractChannelizer - Configured application/json with 
org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0
 -[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+json 
with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0
 -[INFO] AbstractChannelizer - application/json already has 
org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0 
configured - it will not be replaced by 
org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, change 
order of serialization configuration if this is not desired.
 -----
 -
 -Given the above, using GraphSON 3.0 under this configuration will require 
that the user specific the type:
 -
 -[source,text]
 -----
 -$ curl -X POST -d "{\"gremlin\":\"100-1\"}" "http://localhost:8182";
 
-{"requestId":"f8720ad9-2c8b-4eef-babe-21792a3e3157","status":{"message":"","code":200,"attributes":{}},"result":{"data":[99],"meta":{}}}
 -$ curl -H "Accept:application/vnd.gremlin-v3.0+json" -X POST -d 
"{\"gremlin\":\"100-1\"}" "http://localhost:8182";
 
-{"requestId":"9fdf0892-d86c-41f2-94b5-092785c473eb","status":{"message":"","code":200,"attributes":{"@type":"g:Map","@value":[]}},"result":{"data":{"@type":"g:List","@value":[{"@type":"g:Int32","@value":99}]},"meta":{"@type":"g:Map","@value":[]}}
 -----
 -
 -===== Gryo
 -
 -The Gryo serializer utilizes Kryo-based serialization which produces a binary 
output.  This format is best consumed
 -by JVM-based languages. The format itself is described in the
 -link:https://tinkerpop.apache.org/docs/current/dev/io/#gryo[IO Documentation].
 -
 -[source,yaml]
 -  - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerGremlinV1d0 }
 -
 -It has the MIME type of `application/vnd.gremlin-v1.0+gryo` and the following 
configuration options:
 -
 -[width="100%",cols="3,10,^2",options="header"]
 -|=========================================================
 -|Key |Description |Default
 -|bufferSize |The maximum size of the Kryo buffer for use on a single object 
being serialized.  Increasing this value will correct `KryoException` errors 
that complain of "Buffer too small". |_4096_
 -|classResolverSupplier |The fully qualified classname of a custom 
`Supplier<ClassResolver>` which will be used when constructing `Kryo` 
instances. There is no direct default for this setting, but without a setting 
the `GryoClassResolver` is used. |_none_
 -|custom |A list of classes with custom kryo `Serializer` implementations 
related to them in the form of `<class>;<serializer-class>`. |_none_
 -|ioRegistries |A list of `IoRegistry` implementations to be applied to the 
serializer. |_none_
 -|serializeResultToString |When set to `true`, results are serialized by first 
calling `toString()` on each object in the result list resulting in an extended 
MIME Type of `application/vnd.gremlin-v1.0+gryo-stringd`.  When set to `false` 
Kryo-based serialization is applied. |_false_
 -|=========================================================
 -
 -As described above, there are multiple ways in which to register serializers 
for Kryo-based serialization.  Note
 -that the `ioRegistries` setting is applied first, followed by the `custom` 
setting.
 -
 -Those configuring or implementing a `Supplier<ClassResolver>` should consider 
this an "advanced" option and typically
 -important to use cases where server types need to be coerced to client types 
(i.e. a type is available on the server
 -but not on the client).  Implementations should typically instantiate 
`ClassResolver` implementations that are
 -extensions of the `GryoClassResolver` as this class is important to most 
serialization tasks in TinkerPop.
 -
 -===== GraphBinary
 -
 -GraphBinary is a binary serialization format suitable for object trees, 
designed to reduce serialization overhead on
 -both the client and the server, as well as limiting the size of the payload 
that is transmitted over the wire. The
 -format itself is described in the 
link:https://tinkerpop.apache.org/docs/current/dev/io/#graphbinary[IO 
Documentation].
 -
 -IMPORTANT: GraphBinary is currently only supported on the JVM.
 -
 -[source,yaml]
 -  - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1 }
 -
 -It has the MIME type of `application/vnd.graphbinary-v1.0` and the following 
configuration options:
 -
 -[width="100%",cols="3,10,^2",options="header"]
 -|=========================================================
 -|Key |Description |Default
 -|custom |A list of classes with custom kryo `Serializer` implementations 
related to them in the form of `<class>;<serializer-class>`. |_none_
 -|ioRegistries |A list of `IoRegistry` implementations to be applied to the 
serializer. |_none_
 -|builder |Name of the `TypeSerializerRegistry.Builder` instance to be used to 
construct the `TypeSerializerRegistry`. |_none_
 -|=========================================================
 -
 -As described above, there are multiple ways in which to register serializers 
for GraphBinary-based serialization. Note
 -that the `ioRegistries` setting is applied first, followed by the `custom` 
setting.
 -
 -[[metrics]]
 -==== Metrics
 -
 -Gremlin Server produces metrics about its operations that can yield some 
insight into how it is performing. These
 -metrics are exposed in a variety of ways:
 -
 -* Directly to the console where Gremlin Server is running
 -* CSV file
 -* link:http://ganglia.info/[Ganglia]
 -* link:http://graphite.wikidot.com/[Graphite]
 -* link:http://www.slf4j.org/[SLF4j]
 -* link:https://en.wikipedia.org/wiki/Java_Management_Extensions[JMX]
 -
 -The configuration of each of these outputs is described in the Gremlin Server 
<<_configuring_2, Configuring>> section.
 -Note that Graphite and Ganglia are not included as part of the Gremlin Server 
distribution and must be installed
 -to the server manually.
 -
 -[source,text]
 -----
 -bin/gremlin-server.sh install com.codahale.metrics metrics-ganglia 3.0.2
 -bin/gremlin-server.sh install com.codahale.metrics metrics-graphite 3.0.2
 -----
 -
 -WARNING: Gremlin Server is built to work with Metrics 3.0.2. Usage of other 
versions may lead to unexpected problems.
 -
 -NOTE: Installing Ganglia will include `org.acplt:oncrpc`, which is an LGPL 
licensed dependency.
 -
 -Regardless of the output, the metrics gathered are the same. Each metric is 
prefixed with
 -`org.apache.tinkerpop.gremlin.server.GremlinServer` and the following metrics 
are reported:
 -
 -* `sessions` - the number of sessions open at the time the metric was last 
measured.
 -* `errors` - the number of total errors, mean rate, as well as the 1, 5, and 
15-minute error rates.
 -* `op.eval` - the number of script evaluations, mean rate, 1, 5, and 15 
minute rates, minimum, maximum, median, mean,
 -and standard deviation evaluation times, as well as the 75th, 95th, 98th, 
99th and 99.9th percentile evaluation times
 -(note that these time apply to both sessionless and in-session requests).
 -* `op.traversal` - the number of `Traversal` executions, mean rate, 1, 5, and 
15 minute rates, minimum, maximum, median,
 -mean, and standard deviation evaluation times, as well as the 75th, 95th, 
98th, 99th and 99.9th percentile evaluation
 -times.
 -* `engine-name.session.session-id.*` - metrics related to different 
`GremlinScriptEngine` instances configured for
 -session-based requests where "engine-name" will be the actual name of the 
engine, such as "gremlin-groovy" and
 -"session-id" will be the identifier for the session itself.
 -* `engine-name.sessionless.*` - metrics related to different 
`GremlinScriptEngine` instances configured for sessionless
 -requests where "engine-name" will be the actual name of the engine, such as 
"gremlin-groovy".
 -
 -==== As A Service
 -
 -Gremlin server can be configured to run as a service.
 -
 -===== Init.d (SysV)
 -
 -Link `bin/gremlin-server.sh` to `init.d`
 -Be sure to set RUNAS to the service user in `bin/gremlin-server.conf`
 -
 -[source,bash]
 -----
 -# Install
 -ln -s /path/to/apache-tinkerpop-gremlin-server-x.y.z/bin/gremlin-server.sh 
/etc/init.d/gremlin-server
 -
 -# Systems with chkconfig/service. E.g. Fedora, Red Hat
 -chkconfig --add gremlin-server
 -
 -# Start
 -service gremlin-server start
 -
 -# Or call directly
 -/etc/init.d/gremlin-server restart
 -
 -----
 -
 -===== Systemd
 -
 -To install, copy the service template below to 
/etc/systemd/system/gremlin.service
 -and update the paths `/path/to/apache-tinkerpop-gremlin-server` with the 
actual install path of Gremlin Server.
 -
 -[source,bash]
 -----
 -[Unit]
 -Description=Apache TinkerPop Gremlin Server daemon
 -Documentation=https://tinkerpop.apache.org/
 -After=network.target
 -
 -[Service]
 -Type=forking
 -ExecStart=/path/to/apache-tinkerpop-gremlin-server/bin/gremlin-server.sh start
 -ExecStop=/path/to/apache-tinkerpop-gremlin-server/bin/gremlin-server.sh stop
 -PIDFile=/path/to/apache-tinkerpop-gremlin-server/run/gremlin.pid
 -
 -[Install]
 -WantedBy=multi-user.target
 -----
 -
 -
 -Enable the service with `systemctl enable gremlin-server`
 -
 -Start the service with `systemctl start gremlin-server`
 -
--
  === Best Practices
  
  The following sections define best practices for working with Gremlin Server.

Reply via email to