# Users

## Overview

The Users dashboard provides a visual representation of client sessions within a Servoy cloud environment, along with detailed insights into active sessions. It provides both a chart view of the session count and session-specific actions.

<figure><img src="/files/cNrI2y9sFUWysVnxyLev" alt="Cloud Control Center user sessions overview showing session count chart and active sessions list for a Servoy Cloud environment"><figcaption><p>Example of User Sessions Overview</p></figcaption></figure>

## User Sessions Over Time

The **"User Sessions Over Time"** section features a chart displaying the number of user/client sessions over a selected time period. The data can be filtered using the available options for a customized view. You can also hide the chart to focus on other parts of the page.

## Active User Sessions

{% hint style="warning" %}
The Active User Sessions overview is **currently not supported** for [Remote Environments](https://docs.servoy.com/reference/servoy-cloud/cloud-control-center/application-overview/applications/environments/metrics/pages/eg11jvoePw6GRviVLUBP#id-5.-remote-on-premise).
{% endhint %}

The **Active User Sessions** overview offers easy monitoring and management of user sessions within a Servoy cloud environment, ensuring both real-time insights and control over session activity.

<figure><img src="/files/BEv0obTmfUxfB20CHrV5" alt="Active User Sessions section in Cloud Control Center showing user cards with name, solution, server, tenant, idle time, and status"><figcaption><p>Example of Active User Sessions section</p></figcaption></figure>

Each active session is represented by a user card that contains the following information:

* **Username/Client Type**: Displays the username if logged in, or the client type if not. If the session belongs to a Servoy Headless Client, it will display "Servoy Headless Client."
* **"Not signed in" badge:** Emphasizes the difference between logged in clients and those still on the login page
* **Avatar:** The user's avatar from Gravatar is shown. For Servoy Headless Clients, the Servoy logo is displayed.
* **Solution**: The Servoy solution being used (e.g., `svyCloudSampleSolution`).
* **Server**: The server hosting the user session (e.g., `dev-cloudSampleSolution-0-0`).
* **Max Idle Time**: The maximum idle time configured for this session (in minutes). Shows `N/A` if not set. See [how to set Max Idle Time](#tenant-and-max-idle-time).
* **Tenant**: The tenant name associated with this session. Shows `N/A` if not set. See [how to set Tenant](#tenant-and-max-idle-time).
* **Session Status**: Indicates whether the user is online (green dot) or idle (yellow dot).
* **Last Active Timestamp**: Shows the last time the user was active

## Active User Session Details

Each active session has a detailed screen that provides in-depth information and management options for the user or client session. You can access this detail page by clicking on the respective user card from the **Active User Sessions** overview.

The user detail page is divided into the following main sections:

1. **User Details**
2. **Additional Info**
3. **Locks**
4. **Transactions**
5. **Query Performance**
6. **Log activity**
7. **App. Performance**
8. **Actions**

<figure><img src="/files/bMC8stvr6AVU3a5a5S0y" alt="Active User Session detail page in Cloud Control Center showing user info, locks, transactions, query performance, and session actions"><figcaption><p>Active User Details page</p></figcaption></figure>

### Details

This section provides key information about the active session, including:

* **Solution Name**: The Servoy solution currently being used in the session (e.g., `svyCloudSampleSolution`).
* **Server Name**: The server hosting the active session (e.g., `dev-cloudSampleSolution-0-0`).
* **Client Type**: The type of client being used (e.g., Servoy NG Client, Servoy Headless Client etc.).
* **Session Status**: Indicates whether the user is online (green dot) or idle (yellow dot) along with the last active timestamp
* **IP Address**: The IP address of the user
* **Client UUID**: A unique identifier assigned to the client session

### Additional Info

The **Additional Info** tab contains a read-only table displaying user-specific properties that are defined programmatically from within the Servoy Application. Some properties may be, but not limited to:

**Default:**

* **User Agent**: The browser or client information (e.g., `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0`).
* **Platform**: The operating system (e.g., `Win32`).
* **Locale**: The language and region setting (e.g., `en_US`).
* **Session Key**: A unique key used to identify the session (e.g., `2B6980B:2`).

Custom additional information can be added by using:

```
application.addClientInfo('OwnerID: 8');
```

This data is typically used for troubleshooting or auditing purposes and is displayed in a table format for easy review.

### Locks

The **Locks** tab displays a read-only table listing all locks acquired by the user during their session. This can be useful for tracking locked resources and debugging potential issues. Each lock entry includes the following details:

* **Table Name**: The name of the database table where the lock was acquired.
* **Server Name**: The server on which the lock was acquired.
* **Key Locked**: The specific key or record that is locked.
* **Start Time**: The timestamp when the lock was acquired.

This tab helps monitor resource access and ensure that locks are released properly to avoid conflicts.

{% hint style="info" %}
Releasing locks isn't supported yet
{% endhint %}

### Transactions

The **Transactions** tab shows a read-only table of transactions started by the user. This information is crucial for managing database interactions and ensuring transactional integrity. Each transaction entry includes:

* **Transaction ID**: A unique identifier for the transaction.
* **Server Name**: The server where the transaction is taking place.
* **Start Time**: The timestamp when the transaction was initiated.
* **Last Accessed**: The most recent time the transaction was accessed or modified.

This section helps in tracking open transactions, diagnosing any potential issues, and ensuring that long-running transactions do not negatively impact performance.

{% hint style="info" %}
Committing / Rollback of transactions isn't supported yet
{% endhint %}

### Query Performance

The **Query Performance** tab provides insights into the execution time and details of SQL queries run in the environment. This feature helps identify slow-performing queries and optimize database performance.

1. **Date:** Displays the timestamp when the query was executed.
2. **Time (ms):** Indicates the query's execution duration in milliseconds, highlighting performance bottlenecks.
3. **DB Name:** Specifies the database where the query was executed.
4. **Query Type:** Categorizes the query (e.g., Custom, System).
5. **Environment:** Shows the environment where the query was run.
6. **SQL Action:** Displays the SQL query. Long queries are truncated, with an option to expand for full details.

{% hint style="info" %}
Expand the **Show More** section to investigate the full query
{% endhint %}

### Log Activity

The **Log Activity** tab provides a detailed record of system and user-generated logs, enabling efficient monitoring and debugging. Each log entry is categorized by severity and includes key metadata for analysis.

**Columns Explained:**

1. **Date:** Displays the timestamp when the log was generated.
2. **Level:** Categorizes the log severity, such as:
   * **WARN:** Indicates potential issues that may require attention.
   * **INFO:** General information about system activity.
   * **ERROR:** Highlights critical problems that need immediate resolution.
3. **Message:** Provides a brief summary of the log.
4. **Hostname:** Specifies the server or pod where the log was generated.

{% hint style="info" %}
Clicking **Show More** reveals the complete log details for in-depth analysis.
{% endhint %}

### Application Performance

The **App. Performance** tab provides insights into the execution performance of methods executed by the client. It helps monitor average execution times, usage frequency, and potential performance bottlenecks.

**Columns Explained:**

1. **AVG Time:** Displays the average execution time (in milliseconds) for each method.
2. **Count:** Shows the total number of times the method was executed.
3. **Method Name:** Indicates the name of the method being tracked.
4. **Environment:** Specifies the environment where the method was executed (e.g., development, production).

{% hint style="info" %}
Clicking the **info icon** reveals the full stack trace of the method, enabling in-depth debugging and performance analysis.
{% endhint %}

### User Actions

In addition to viewing session details, the **Actions** button allows you to manage the session directly. You can:

* [**Message User**](#message-user): Send a direct message to the user of the session. This is useful for notifying the user of upcoming system maintenance or other critical updates.
* [**Shutdown Client**](#shutdown-client): Forcefully terminate the user’s session, which may be necessary for troubleshooting or security purposes.

Refer to the [Actions section](#actions) below for detailed instructions on performing these tasks and understanding their associated restrictions.

## Actions

{% hint style="info" %}
In **Production Environments,** messaging and shutdown actions are restricted to users with **Administrator** permissions
{% endhint %}

Actions can be performed at two levels: **user-level** and **overview-level**.

#### User-Level Actions

These actions apply to individual user sessions:

* **Message User**: Send a message directly to a specific user.
* **Shutdown Client**: Forcefully terminate a user’s session

<div align="center"><figure><img src="/files/sQHQsnRUXdXXLTgArtlL" alt="User-level action menu on a session card showing Message User and Shutdown Client options"><figcaption><p>User-Level Actions from Active User Sessions section</p></figcaption></figure></div>

{% hint style="info" %}
You can access user-level actions both from the user card on the main **Active User Sessions** page and from the [**User Detail**](#active-user-session-details) screen of that session.
{% endhint %}

#### Overview-Level Actions

These actions apply to all active sessions in the environment:

* **Refresh Users:** Refresh the list of active sessions
* **Send message to all users:** Send a message to all currently active users
* **Shutdown all clients:** Shut down all active user sessions in the list

<figure><img src="/files/l7mXcqcUDidbb7S7WXHI" alt="Overview-level Actions menu in Active User Sessions showing Refresh Users, Send message to all users, and Shutdown all clients options"><figcaption><p>Overview-Level Actions from Active User Sessions section</p></figcaption></figure>

### Message user

You can send a message to a specific user from either the [**User Detail**](#active-user-session-details) screen or the user card on the main page.

{% hint style="info" %}
**Note:** Messaging Servoy Headless Clients is not supported.

In **Production Environments,** messaging and shutdown actions are restricted to users with **Administrator** permissions
{% endhint %}

**Steps to Message a User:**

1. **From the Active User Sessions page:**
   * Navigate to **Environment Details -> User Count -> Active User Sessions**.
   * Locate the desired user card.
   * Click the context menu (top-right corner of the user card).
   * Select **Message User** to open the message dialog.
   * Enter your message and click **Send**.
2. **From the User Detail screen:**
   * Access the **User Detail screen** by clicking on the user card.
   * Use the **Actions** button on the detail page.
   * Select **Message User** and follow the same steps to send a message.

<figure><img src="/files/hp0siVY2I5HTCcqhkxuc" alt="Message User dialog in Cloud Control Center with a text field to send a message to an active session" width="563"><figcaption><p>Message User Dialog from Active User Sessions section</p></figcaption></figure>

### Shutdown client

You can shut down a specific user session from either the [**User Detail**](#active-user-session-details) screen or directly from the user card.

**Steps to Shutdown a Client:**

1. **From the Active User Sessions page:**
   * Navigate to **Environment Details -> User Count -> Active User Sessions**.
   * Click the context menu (top-right corner of the user card) for the session you want to terminate.
   * Select **Shutdown Client** and confirm by clicking **Shutdown client**.
2. **From the User Detail screen:**
   * Access the **User Detail screen** by clicking on the user card.
   * Use the **Actions** button and select **Shutdown Client** to terminate the session.

{% hint style="info" %}
In **Production Environments,** messaging and shutdown actions are restricted to users with **Administrator** permissions
{% endhint %}

## Tenant and Max Idle Time

The **Tenant** and **Max Idle Time** columns in the Active User Sessions table are populated from your Servoy application. You set these values using the **svyCloudUtils** module — do not call `application.addClientInfo()` directly, as calling it multiple times for the same key will produce incorrect results.

Use the helper methods in `svyCloudUtils` to set these values safely:

```javascript
// Set the tenant name shown in the Tenant column
scopes.svyCloud.setTenantName('Acme Corp');

// Set a tenant-specific value (e.g. tenant ID or customer code)
scopes.svyCloud.setTenantValue('CUST-001');

// Set the max idle time in minutes shown in the Max Idle Time column
scopes.svyCloud.setMaxIdleTime(30);
```

Call these methods after login, typically in your solution's `onOpen` or after user authentication.

If a value is not set, the column shows `N/A`.

The active session data is loaded when the page is displayed, but it is not updated in real-time.

To refresh the session list and bring it up to date:

1. **Navigate to Active User Sessions:**
   * Go to `Environment Details -> User Count -> Active User Sessions`
2. **Refresh Users**
   * Click the **Actions** button to open the actions menu.
   * Select **Refresh Users** to update the session list.

### Send message to all users

To broadcast a message to all active user sessions displayed in the list:

1. **Navigate to Active User Sessions:**
   * Go to `Environment Details -> User Count -> Active User Sessions`
2. **Message User**
   * Open the **Actions** menu by clicking the **Actions** button.
   * Select **Send message to all users**.
   * Enter your message in the dialog and click **Send**.

{% hint style="info" %}
**Note:** Messaging Servoy Headless Clients is not supported.

In **Production Environments,** messaging and shutdown actions are restricted to users with **Administrator** permissions
{% endhint %}

### Shutdown all clients

To shut down all active user sessions displayed in the list:

1. **Navigate to Active User Sessions:**
   * Go to `Environment Details -> User Count -> Active User Sessions`
2. **Shut down client**
   * Open the **Actions** menu by clicking the **Actions** button.
   * Select **Shutdown all clients** and confirm your intent by clicking the **Shutdown clients** button.

{% hint style="info" %}
In **Production Environments,** messaging and shutdown actions are restricted to users with **Administrator** permissions
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.servoy.com/reference/servoy-cloud/cloud-control-center/application-overview/applications/environments/metrics/users.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
