#include <errno.h>#include <fcntl.h>#include <getopt.h>#include <math.h>#include <signal.h>#include <string.h>#include <sys/mman.h>#include <sys/stat.h>#include <sys/time.h>#include <sys/types.h>#include <unistd.h>#include <netinet/tcp.h>#include <sys/socket.h>#include "afpclient.h"#include "afpcmd.h"#include "afphelper.h"#include "testhelper.h"#include "afp_tcp_analytics.h"#include "speedtest_local_vfs.h"Data Structures | |
| struct | TestStats |
| struct | SizeSweepResult |
| struct | AllTestResults |
| struct | test_entry |
Macros | |
| #define | KILOBYTE 1024 |
| #define | MEGABYTE (KILOBYTE*KILOBYTE) |
| #define | MAX_ITERATIONS 1000 |
| #define | MAX_SIZE_SWEEP 32 |
Enumerations | |
| enum | OutputFormat { OUTPUT_TEXT , OUTPUT_CSV } |
Functions | |
| int32_t | is_there (CONN *conn, uint16_t volume, int32_t did, char *name) |
| static void | press_enter (char *s) |
| Display message and wait for user to press Enter. | |
| unsigned long long | delta (void) |
| static int | compare_ulonglong (const void *a, const void *b) |
| Compare function for qsort() to sort unsigned long long values. | |
| static void | calculate_statistics (TestStats *stats) |
| Calculate mean, median, stddev, and percentiles from timing samples. | |
| static void | record_timing (unsigned long long microseconds) |
| Record single timing measurement for current test. | |
| static void | reset_statistics (void) |
| Reset statistics counters for next test iteration. | |
| static void | print_statistics_text (const char *test_name) |
| Print statistics in human-readable text format. | |
| static void | print_csv_header (void) |
| Print CSV header row with column names. | |
| static void | print_csv_statistics (const char *test_name, off_t file_size) |
| Print CSV statistics row with mean, median, stddev, percentiles. | |
| static void | run_one (char *name) |
| Execute single test by name (Read/Write/Copy/ServerCopy). | |
| static void | print_test_summary (const char *test_name, const SizeSweepResult *results, int result_count) |
| static void | print_size_sweep_tables (void) |
| Print file size performance summary tables for all test types. | |
| static void | run_one_with_size_sweep (char *test_name) |
| Execute test with file size sweep mode enabled. | |
| static void | print_and_collect_results (const char *test_name) |
| Print results and collect statistics for size sweep mode. | |
| static int | check_test_dir_exists (uint16_t vol, char *dir_name, const char *test_name) |
| static void | print_iteration_marker (int iteration, int display_iter) |
| Print iteration number marker for progress tracking. | |
| static void | print_test_header (const char *test_name) |
| Print test header with name and configuration. | |
| static void | header (void) |
| Print test header with timestamp. | |
| static void | timer_footer (const char *test_name, int iteration) |
| Print timing results and record statistics after test iteration. | |
| void | Write (void) |
| Execute Write test with configured file size and iterations. | |
| int | init_fork (uint16_t fork) |
| Initialize fork by truncating to 0 then setting to File_size. | |
| static int | getfd (CONN *conn, int fork) |
| Get file descriptor from fork (AFP or Local mode). | |
| void | Copy (void) |
| Execute Copy test with configured file size and iterations. | |
| void | ServerCopy (void) |
| Execute ServerCopy test with configured file size and iterations. | |
| void | Read (void) |
| Execute Read test with configured file size and iterations. | |
| void | usage (char *av0) |
| Display usage information and exit. | |
| int | main (int ac, char **av) |
| Main entry point: parse arguments, setup connection, run tests. | |
Variables | |
| uint16_t | VolID |
| uint16_t | VolID2 |
| static DSI * | dsi |
| CONN * | Conn |
| int | ExitCode = 0 |
| DSI * | Dsi |
| char | Data [30000] |
| char * | Buffer |
| struct timeval | Timer_start |
| struct timeval | Timer_end |
| static TestStats | current_test_stats |
| static int | enable_statistics = 0 |
| static int | in_warmup_phase = 0 |
| static OutputFormat | output_format = OUTPUT_TEXT |
| static int | csv_header_printed = 0 |
| static TcpAnalyticsSession | tcp_session |
| char * | Server = "localhost" |
| static int | Port = DSI_AFPOVERTCP_PORT |
| static char * | Password = "" |
| char * | Vol = "" |
| char * | Vol2 = "" |
| static char * | LocalPath = "" |
| char * | User |
| int | Version = 34 |
| char * | Test = "Write" |
| static char * | Filename |
| char * | vers = "AFP3.4" |
| char * | uam = "Cleartxt Passwrd" |
| static int | Count = 1 |
| static int | WarmupRuns = 1 |
| static int | DelaySeconds = 0 |
| static off_t | Size = 64 * MEGABYTE |
| static int | size_sweep_enabled = 0 |
| static off_t | size_sweep_values [MAX_SIZE_SWEEP] |
| static int | size_sweep_count = 0 |
| static AllTestResults | all_results |
| static size_t | Quantum = 0 |
| static int | Request = 1 |
| static int | Delete = 0 |
| static int | Sparse = 0 |
| static int | Local = 0 |
| static int | Flush = 1 |
| static int | Direct = 1 |
| CONN * | Conn2 |
| int | Mac = 0 |
| int | EmptyVol = 0 |
| int | PassCount = 0 |
| int | FailCount = 0 |
| int | SkipCount = 0 |
| int | NotTestedCount = 0 |
| char | FailedTests [1024][256] = {{0}} |
| char | NotTestedTests [1024][256] = {{0}} |
| char | SkippedTests [1024][256] = {{0}} |
| struct vfs | VFS |
| static struct test_entry | test_table [] |
| #define KILOBYTE 1024 |
| #define MAX_ITERATIONS 1000 |
| #define MAX_SIZE_SWEEP 32 |
| enum OutputFormat |
|
static |
Calculate mean, median, stddev, and percentiles from timing samples.
|
static |
|
static |
Compare function for qsort() to sort unsigned long long values.
| void Copy | ( | void | ) |
Execute Copy test with configured file size and iterations.
| unsigned long long delta | ( | void | ) |
|
static |
Get file descriptor from fork (AFP or Local mode).
|
static |
Print test header with timestamp.
| int init_fork | ( | uint16_t | fork | ) |
Initialize fork by truncating to 0 then setting to File_size.
| int32_t is_there | ( | CONN * | conn, |
| uint16_t | volume, | ||
| int32_t | did, | ||
| char * | name ) |
| int main | ( | int | ac, |
| char ** | av ) |
Main entry point: parse arguments, setup connection, run tests.
|
static |
Display message and wait for user to press Enter.
|
static |
Print results and collect statistics for size sweep mode.
|
static |
Print CSV header row with column names.
|
static |
Print CSV statistics row with mean, median, stddev, percentiles.
|
static |
Print iteration number marker for progress tracking.
|
static |
Print file size performance summary tables for all test types.
|
static |
Print statistics in human-readable text format.
|
static |
Print test header with name and configuration.
|
static |
| void Read | ( | void | ) |
Execute Read test with configured file size and iterations.
|
static |
Record single timing measurement for current test.
|
static |
Reset statistics counters for next test iteration.
|
static |
Execute single test by name (Read/Write/Copy/ServerCopy).
|
static |
Execute test with file size sweep mode enabled.
| void ServerCopy | ( | void | ) |
Execute ServerCopy test with configured file size and iterations.
|
static |
Print timing results and record statistics after test iteration.
| void usage | ( | char * | av0 | ) |
Display usage information and exit.
| void Write | ( | void | ) |
Execute Write test with configured file size and iterations.
|
static |
| char* Buffer |
| CONN* Conn |
| CONN* Conn2 |
|
static |
|
static |
|
static |
| char Data[30000] |
|
static |
|
static |
|
static |
| DSI* Dsi |
|
static |
| int EmptyVol = 0 |
|
static |
| int ExitCode = 0 |
| int FailCount = 0 |
| char FailedTests[1024][256] = {{0}} |
|
static |
|
static |
|
static |
|
static |
|
static |
| int Mac = 0 |
| int NotTestedCount = 0 |
| char NotTestedTests[1024][256] = {{0}} |
|
static |
| int PassCount = 0 |
|
static |
|
static |
|
static |
|
static |
| char* Server = "localhost" |
|
static |
|
static |
|
static |
|
static |
| int SkipCount = 0 |
| char SkippedTests[1024][256] = {{0}} |
|
static |
|
static |
| char* Test = "Write" |
|
static |
| struct timeval Timer_end |
| struct timeval Timer_start |
| char* uam = "Cleartxt Passwrd" |
| char* User |
| char* vers = "AFP3.4" |
| int Version = 34 |
| struct vfs VFS |
| char* Vol = "" |
| char* Vol2 = "" |
| uint16_t VolID |
| uint16_t VolID2 |
|
static |