pacemaker  2.1.2-ada5c3b36
Scalable High-Availability cluster resource manager
Functions
pcmki_simulate.h File Reference
#include <crm/common/output_internal.h>
#include <crm/pengine/pe_types.h>
#include <pacemaker.h>
#include <stdbool.h>
Include dependency graph for pcmki_simulate.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int pcmk__write_sim_dotfile (pe_working_set_t *data_set, const char *dot_file, bool all_actions, bool verbose)
 Write out a file in dot(1) format describing the actions that will be taken by the scheduler in response to an input CIB file. More...
 
void pcmk__profile_file (const char *xml_file, long long repeat, pe_working_set_t *data_set, char *use_date)
 Profile the configuration updates and scheduler actions in a single CIB file, printing the profiling timings. More...
 
void pcmk__profile_dir (const char *dir, long long repeat, pe_working_set_t *data_set, char *use_date)
 Profile the configuration updates and scheduler actions in every CIB file in a given directory, printing the profiling timings for each. More...
 
void pcmk__set_effective_date (pe_working_set_t *data_set, bool print_original, char *use_date)
 Set the date of the cluster, either to the value given by use_date, or to the "execution-date" value in the CIB. More...
 
int pcmk__simulate (pe_working_set_t *data_set, pcmk__output_t *out, pcmk_injections_t *injections, unsigned int flags, unsigned int section_opts, char *use_date, char *input_file, char *graph_file, char *dot_file)
 Simulate a cluster's response to events. More...
 

Function Documentation

◆ pcmk__profile_dir()

void pcmk__profile_dir ( const char *  dir,
long long  repeat,
pe_working_set_t data_set,
char *  use_date 
)

Profile the configuration updates and scheduler actions in every CIB file in a given directory, printing the profiling timings for each.

Note
data_set->priv must have been set to a valid pcmk__output_t object before this function is called.
Parameters
[in]dirA directory full of CIB files to be profiled.
[in]repeatNumber of times to run on each input file.
[in]data_setWorking set for the cluster.
[in]use_dateThe date to set the cluster's time to (may be NULL).

Definition at line 289 of file pcmk_simulate.c.

◆ pcmk__profile_file()

void pcmk__profile_file ( const char *  xml_file,
long long  repeat,
pe_working_set_t data_set,
char *  use_date 
)

Profile the configuration updates and scheduler actions in a single CIB file, printing the profiling timings.

Note
data_set->priv must have been set to a valid pcmk__output_t object before this function is called.
Parameters
[in]xml_fileThe CIB file to profile.
[in]repeatNumber of times to run.
[in]data_setWorking set for the cluster.
[in]use_dateThe date to set the cluster's time to (may be NULL).

Definition at line 249 of file pcmk_simulate.c.

◆ pcmk__set_effective_date()

void pcmk__set_effective_date ( pe_working_set_t data_set,
bool  print_original,
char *  use_date 
)

Set the date of the cluster, either to the value given by use_date, or to the "execution-date" value in the CIB.

Note
data_set->priv must have been set to a valid pcmk__output_t object before this function is called.
Parameters
[in,out]data_setWorking set for the cluster.
[in]print_originalIf true, the "execution-date" should also be printed.
[in]use_dateThe date to set the cluster's time to (may be NULL).

Definition at line 327 of file pcmk_simulate.c.

◆ pcmk__simulate()

int pcmk__simulate ( pe_working_set_t data_set,
pcmk__output_t out,
pcmk_injections_t injections,
unsigned int  flags,
unsigned int  section_opts,
char *  use_date,
char *  input_file,
char *  graph_file,
char *  dot_file 
)

Simulate a cluster's response to events.

This high-level function essentially implements crm_simulate(8). It operates on an input CIB file and various lists of events that can be simulated. It optionally writes out a variety of artifacts to show the results of the simulation. Output can be modified with various flags.

Parameters
[in,out]data_setWorking set for the cluster.
[in,out]outThe output functions structure.
[in]eventsA structure containing cluster events (node up/down, tickets, injected operations) and related data.
[in]flagsA bitfield of :pcmk_sim_flags to modify operation of the simulation.
[in]section_optsWhich portions of the cluster status output should be displayed?
[in]use_dateThe date to set the cluster's time to (may be NULL).
[in]input_fileThe source CIB file, which may be overwritten by this function (may be NULL).
[in]graph_fileWhere to write the XML-formatted transition graph (may be NULL, in which case no file will be written).
[in]dot_fileWhere to write the dot(1) formatted transition graph (may be NULL, in which case no file will be written). See pcmk__write_sim_dotfile().
Returns
Standard Pacemaker return code

Definition at line 358 of file pcmk_simulate.c.

◆ pcmk__write_sim_dotfile()

int pcmk__write_sim_dotfile ( pe_working_set_t data_set,
const char *  dot_file,
bool  all_actions,
bool  verbose 
)

Write out a file in dot(1) format describing the actions that will be taken by the scheduler in response to an input CIB file.

Parameters
[in]data_setWorking set for the cluster.
[in]dot_fileThe filename to write.
[in]all_actionsWrite all actions, even those that are optional or are on unmanaged resources.
[in]verboseAdd extra information, such as action IDs, to the output.
Returns
Standard Pacemaker return code

Definition at line 152 of file pcmk_simulate.c.