Skip to content

Commit

Permalink
Finished CommandLine
Browse files Browse the repository at this point in the history
  • Loading branch information
WellFiredDevelopment committed Dec 19, 2017
1 parent 23104d6 commit a86ea21
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 1 deletion.
33 changes: 33 additions & 0 deletions sphinx/source/learn/advanced/commandline.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.. _learn_advanced_commandline:

Introduction
============

One of the more useful, but slightly more advanced functionality of .Profile is the ability to launch your application
from the command line with a selection of command line arguments allowing you to automatically start a custom recording
session. This doesn't require any code on your side, which is precisely why this functionality is so amazing, it just
works out of the box.

Usage
=====

When you install .Profile, you also install a pre configured command line profile configuration. It's located in your
project and called Framerate.pcfg. Feel free to open this and have a look at the format (it's plain Json). We'll use
this bundled configuration to show you how .Profile can leverage out of the box command line profiling.

.. warning:: .Profile ships with a link.xml file, this file tells unity not to strip out .Profile's assemblies when
it builds a new player, it's important you have this link.xml file in your project prior to building
your player.

1) After installing .Profile, build a player for your desired platform.
2) Run your player with the following command line arguments
::

path/to/your/player.exe -DotProfileConfig "Framerate"

And that's it, your application should be launched and a session will automatically be created using the Framerate.pcfg
config.

.. note:: You can create your own profile configuration files and ship them with your product, if you want to enable
a user facing command line interface, allowing your customers the option to profile their existing game.
Similar to how Valve ship a profiler with their hammer based products.
9 changes: 9 additions & 0 deletions sphinx/source/learn/advanced/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Advanced
========

.. toctree::
:maxdepth: 1
:name: toc-learn-advanced
:glob:

commandline.rst
2 changes: 1 addition & 1 deletion sphinx/source/learn/step_by_step/probes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ continuous and one shot probes. Out of the box, .Profile provides probes for the

+-----------------------------------+----------------------+----------------------------------------------+
| Name | Probe Type | Tracks |
+-----------------------------------+----------------------+----------------------------------------------+
+===================================+======================+==============================================+
| Defaults.Continuous | Continuous | CPU load and framerate |
+-----------------------------------+----------------------+----------------------------------------------+
| Defaults.ContinuousMemory | Continuous | Memory usage across many systems |
Expand Down
47 changes: 47 additions & 0 deletions sphinx/source/learn/step_by_step/session.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
Session
=======

Introduction
------------

A session is a simple construct that refers to the start and end of a recording session. This recording session takes
Probes as inputs and Processors as outputs (More on that in the coming pages).

Managing a session
------------------

A Session object is required to manage a session, a session can be constructed by hand, but we provide a simple
interface for users to easily initialise a session. You can do this with the following steps.

1) Add the required using

.. code-block:: c#
using WWellFired.Profile.Unity.Runtime;
2) Tell your session to track the data you require.

.. code-block:: c#
var session = DotProfileSession.New();
Now you've got a session, you should start it when you want to start recording data.

.. code-block:: c#
session.StartRecording();
You can also tell your session to stop recording when you don't require it to record anymore.

.. code-block:: c#
session.StopRecording();
.. tip:: In these examples, we show you how to use and manage a single session, but it's important to mention you're
not limited to just one, you can create as many as you want / need.

Sessions will automatically stop recording when your application terminates, but we provide the functionality for you
to stop them, in case you want to manage your sessions in a custom manor.

Next up
-------

Sessions are a small topic, with not many functions, but they're the cornerstone of your recording process. We're going
to teach you how to make them more useful in the coming pages.

0 comments on commit a86ea21

Please sign in to comment.