Changeset f0c2368bc65ecc30e12507bd8c0ce078fd060a4a

Show
Ignore:
Timestamp:
10/23/09 02:42:36 (4 years ago)
Author:
Robert Treat <robert@omniti.com>
git-committer:
Robert Treat <robert@omniti.com> 1256265756 +0000
git-parent:

[fec00b8f462299cc0a254a35c864cd59c26cd33a]

git-author:
Robert Treat <robert@omniti.com> 1256265756 +0000
Message:

fix vars to match real config table, note on busted sql

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sql/sprocs/rollup_metric_numeric_generic.sql

    ra51617d rf0c2368  
    3434END IF; 
    3535 
    36 SELECT * FROM stratcon.window_config WHERE win = in_roll INTO v_conf;  
     36SELECT * FROM stratcon.metric_numeric_rollup_config WHERE rollup = in_roll INTO v_conf;  
    3737 
    3838LOOP 
     
    6363    END IF; 
    6464 
     65/* THIS V_SQL NEEDS TO BE REWRITTEN TO GET THE VALUE FROM ARRAY BASED TABLES */  
    6566    v_sql := 'SELECT sid, name, '|| v_min_whence || ' as rollup_time,  
    6667                     SUM(1) as count_rows ,(SUM(avg_value*1)/SUM(1)) as avg_value,  
    6768                     (SUM(counter_dev*1)/SUM(1)) as counter_dev  
    68               FROM metric_numeric_rollup_'||v_conf.dep_roll||'  
    69               WHERE rollup_time<= '|| v_min_whence ||' AND rollup_time > ' || v_min_whence - v_conf.int * '1 second'::interval || ' 
     69              FROM metric_numeric_rollup_'||v_conf.dependent_on||'  
     70              WHERE rollup_time<= '|| v_min_whence ||' AND rollup_time > ' || v_min_whence - v_conf.seconds * '1 second'::interval || ' 
    7071              GROUP BY sid, name'; 
    7172 
    7273    FOR v_rec IN EXECUTE v_sql LOOP 
    73             v_stored_rollup := floor(extract('epoch' from v_rec.rollup_time)/v_conf.window)+vconf.window;  
    74             v_offset := floor( (extract('epoch' from v_rec.rollup_time) - v_stored_rollup) / v_conf.int ); 
     74            v_stored_rollup := floor(extract('epoch' from v_rec.rollup_time)/v_conf.span)+vconf.window;  
     75            v_offset := floor( (extract('epoch' from v_rec.rollup_time) - v_stored_rollup) / v_conf.seconds ); 
    7576  
    7677            --v_offset := ( 12*(extract('hour' from v_info.rollup_time))+floor(extract('minute' from v_info.rollup_time)/5) );